Skip Navigation

[Résolu] Beaver Builder broken using suggested shortcode calculations

This support ticket is created Il y a 7 années et 5 mois. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

Marqué : 

This topic contains 3 réponses, has 2 voix.

Last updated by Jaffa Il y a 7 années et 5 mois.

Assisted by: Minesh.

Auteur
Publications
#460006

The site was working fine and now all of a sudden I can't access the template using Beaver Builder.

In the functions.php I have the following code to allow me to do a simple calculation on a field within this single page template:

add_shortcode('wpv-calculate', 'calculate_shortcode');
function calculate_shortcode($atts,$content=null) {
$content = wpv_do_shortcode($content);

$content = eval("return $content;");
return round($content);
}

With this code enabled in the functions.php file the Beaver Builder page builder breaks as seen in the screenshot, Can someone please point me in the right correction to the new correct use of the calculation shortocode within the functins.php page

#460145

Minesh
Supporter

Languages: Anglais (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

This is really strange.

Could you please share problem URL of your page and temporary access details.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).

I have set the next reply to private which means only you and I have access to it.

#460512

Minesh
Supporter

Languages: Anglais (English )

Timezone: Asia/Kolkata (GMT+05:30)

I would like to know that are you using [wpv-calculate] shortcode other than "Single Template for Home Designs" template?

if no - then its OK.
If yes - Please let me know.

The issue was on builder page it was not able to parse the eval() argument string.
I've modified the function as given under:

add_shortcode('wpv-calculate', 'calculate_shortcode');
function calculate_shortcode($atts,$content=null) {
$content = wpv_do_shortcode($content);
$arr = explode("/",$content);
if(isset($arr[0]) and $arr[1]){
$total = $arr[0]/$arr[1];	
}
return round($total);
}

Now, builder page is loading normally. Could you please confirm.

#460825

Hi Minesh, I was only using the shortcode on the single template and everything now looks fine. Thanks you for your time and effort to resolve this issue for me. Have a nice day.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.