Error "PHP Fatal error: Cannot redeclare has_shortcode()" Imprimir

  • 1

Si observamos este error en nuestros logs después de actualizar WP

 

Debemos de desactivar la función shortcode en

 

/wp-content/themes/nuestro-tema/framework/functions/common.php

 

Podemos comentarla así


"has_shortcode()" and comment this function. This should be like this:

/*
function has_shortcode() {
....
}
*/
-----------queda asi----------

<?php

// check the current post for the existence of a short code
/*
function has_shortcode($shortcode = '') {

    $post_to_check = get_post(get_the_ID());

    // false because we have to search through the post content first
    $found = false;

    // if no short code was provided, return false
    if (!$shortcode) {
        return $found;
    }
    // check the post content for the short code
    if ( stripos($post_to_check->post_content, '[' . $shortcode) !== false ) {
        // we have found the short code
        $found = true;
    }

    // return our final results
    return $found;
}
*/

-------------


Esta resposta foi útil?

« Voltar