upgrade to 4.0.1 from 4.0.0 broke the whole site
-
Today, after the upgrade to 4.0.1, i got this error on the site’s homepage:
Fatal error: Call to undefined function gotowp_custom_has_shortcode() in /var/www/xxxxxx/public_html/wp-content/plugins/gotowp/_gotowpp_inc.php on line 3308
Looking at the the incriminated lines, the error is in the function:
———————–
function gotowp_personal_has_shortcode($shortcode) {
global $post;
$found = false;if (function_exists ( ‘has_shortcode’ ) && is_object($post) && has_shortcode ( $post->post_content, $shortcode )) {
$found = true;
}
elseif (gotowp_custom_has_shortcode ( $shortcode )) {
$found = true;
}else{
$stags = array($shortcode);
$pattern = get_shortcode_regex($stags);
if ( preg_match_all( ‘/’. $pattern .’/s’, $post->post_content, $matches ) && array_key_exists( 2, $matches ) && (in_array( $shortcode, $matches[2] )) )
{
$found = true;
}
}
return $found;
}
—————–
I’ve substitute the whole function with the 4.0.0’s version:
—————–
function gotowp_personal_has_shortcode($shortcode) {
global $post;
$found = false;
if (function_exists ( ‘has_shortcode’ )) {
if (is_object($post) && has_shortcode ( $post->post_content, $shortcode )) {
$found = TRUE;
}
} else {
if (gotowp_custom_has_shortcode ( $shortcode )) {
$found = TRUE;
}
}
return $found;
}
—————–Now it works or, at least, it doesn’t break the whole site.
Please fix this bug ASAP, because i think that it could break lot of sites, maybe production sites, not staging’s version as in my case.I’m using wp 4.8.2 with latest php 5.6
Regards
- The topic ‘upgrade to 4.0.1 from 4.0.0 broke the whole site’ is closed to new replies.