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?
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?