• Resolved Uwhoosh

    (@uwhoosh)


    Wanted to upgrade my server PHP to version 5.6, but first run a test and got this error in functions.php:

    866 | ERROR | Parameter shadowing super global ($_post) causes fatal error since PHP 5.4

    So I can’t upgrade, since it will break the site.
    Any ideas on how I can fix this?

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi There,

    Please find the below function on functions.php and remove the whole function, if this is not helpful to you then please let us know;

    if ( ! function_exists( 'celestial_lite_post_is_in_descendant_category' ) ) {
        function celestial_lite_post_is_in_descendant_category( $cats, $_post = null ) {
            foreach ( (array) $cats as $cat ) {
                // get_term_children() accepts integer ID only
                if ( is_string( $cat ) ) {
                    $cat = get_term_by( 'slug', $cat, 'category' );
                    if ( ! isset( $cat, $cat->term_id ) )
                        continue;
                    $cat = $cat->term_id;
                }
                $descendants = get_term_children( (int) $cat, 'category' );
                if ( $descendants && in_category( $descendants, $_post ) )
                    return true;
            }
            return false;
        }
    }

    Thanks

    Hi Uwhoosh,

    That’s Great! if it works perfectly. And sure we will fix this issue in our theme update, as per you said. As now we are closing this topic, if you have any other issue then please let us know. We hope you understand.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘PHP 5.6 Compatibility’ is closed to new replies.