• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

RESOLVED Woody Snippets fails unless support old shortcodes is on

Messages
5
Likes
0
Points
1
#1
We recently updated our plugins on our WP site - after doing so site would not load properly. After a lengthy process we narrowed down the problem to the PHP code snippets (insert PHP) - if we updated that the site failed. The failure manifested in the Site Origin built pages not loading their content - header and footer fine - no content.
When wp_debug was enabled we got the following warning.
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'will_bontrager_insert_php' not found or invalid function name in /home/public_html/wp-includes/class-wp-hook.php on line 286

After some trial and error we narrowed it down to a wbcr shortcode that was on the pages that did not load.
The short code looked like this
[wbcr_php_snippet id="9999"] - i.e. we were not using the old [insert_php]
If we turn the Support old Shortcodes ON - the page loads - and we don't get the warning above.

To confirm this was the issue we created a new snippet. All the snippet does is echo's out an empty div with a style set to none and a class with a unique name that will make it easy to find in the source.
We then created a new page. We then did the following
Add an SO panel with an SO Editor widget
Added a heading
Add the [wbcr_php_snippet id="XXXX"] where XXXX is the id of the snippet we created above
We then turned the Support old Shortcode OFF
Attempted to load the page
Received the above warning 4 times - snippet not inserted
Turned the Support old Shortcode ON - page loaded and div created.

Why are we required to turn legacy support on when we are not using the legacy tags?
 

Temyk

Developer & Support
Messages
1,129
Likes
42
Points
48
#2
Здравствуйте.

Please check if you have a file wp-content\plugins\insert-php\includes\shortcodes\shortcode-insert-php.php
And send us your snippets code so I can check it.
 
Messages
5
Likes
0
Points
1
#3
File does exist - see screen grab below.
Snippet is dead simple - and it works when the legacy support is turned on
PHP:
echo '<div style="display:none" class="find_me_xxx"></div>';
ss1.jpg


How we are adding the snippet to the page

ss2.jpg
 

Temyk

Developer & Support
Messages
1,129
Likes
42
Points
48
#4
Sorry for the delay in replying. Can you give access to the admin area of your site? and specify where exactly is the shortcode
 
Messages
5
Likes
0
Points
1
#6
Unfortunately I cannot give you access to the site.
As I mentioned before.
1. I created a new PHP Snippet
2. I pasted the echo statement as above
3. I created a new page
4. I added the snippet code to the page

That creates the problem.
 

Temyk

Developer & Support
Messages
1,129
Likes
42
Points
48
#7
Unfortunately, without access to the site, I won't be able to help you quickly enough.

Try to insert the shortcode via classic editor of Wordpress (not through the Site Origin).
 
Messages
5
Likes
0
Points
1
#8
I sent login details through your form yesterday but have heard nothing back - can you confirm you received the credentials?
 

Temyk

Developer & Support
Messages
1,129
Likes
42
Points
48
#9
Not immediately understand how to enter the site. Now it worked. Looking for the problem
 

Temyk

Developer & Support
Messages
1,129
Likes
42
Points
48
#10
The problem was in your theme "Weaver Xtreme Child Theme". Its author uses Woody functionality in it, so there was an error message.

You need to change the functions.php theme file and delete these two lines.
1561534942689.png