Fatal error: Cannot redeclare use_block_editor_for_post

  • Unknown's avatar

    Hi, I’m trying to access the wordpress control panel of the website ameigadasareas.com with the link: http://ameigadasareas.com/wp-admin/

    And I got the following warning:
    There has been a critical error on this website. Please check your site administrator’s email inbox for instructions.

    Learn more about WordPress diagnostics.

    I tried several options that I found on google like changing the name of the plugins folder, modify the .php function files with “ss” and I still can’t access.

    The error I get is the following:
    Fatal error: Cannot redeclare use_block_editor_for_post() (previously declared in /home/xmucsdyl/public_html/wp-includes/post.php:8067) in /home/xmucsdyl/public_html/wp-admin/includes/post.php on line 2176

    And this is what is written:
    /**
    * Returns whether the post can be edited in the block editor.
    *
    * @since 5.0.0
    *
    * @param int|WP_Post $post Post ID or WP_Post object.
    * @return bool Whether the post can be edited in the block editor.
    */
    function use_block_editor_for_post( $post ) {
    $post = get_post( $post );

    if ( ! $post ) {
    return false;
    }

    // We’re in the meta box loader, so don’t use the block editor.
    if ( isset( $_GET[‘meta-box-loader’] ) ) {
    check_admin_referer( ‘meta-box-loader’, ‘meta-box-loader-nonce’ );
    return false;
    }

    $use_block_editor = use_block_editor_for_post_type( $post->post_type );

    /**
    * Filters whether a post is able to be edited in the block editor.
    *
    * @since 5.0.0
    *
    * @param bool $use_block_editor Whether the post can be edited or not.
    * @param WP_Post $post The post being checked.
    */
    return apply_filters( ‘use_block_editor_editor_for_post’, $use_block_editor, $post );
    }

    Can you help me? I have been referred to this website and I don’t know what is wrong with it.

    Thank you very much for your help.

    Translated with http://www.DeepL.com/Translator (free version)

  • Hello there,

    This site is not hosted with us on WordPress.com, but using the open source WordPress software at another hosting provider. This is a bit different to a site hosted on WordPress.com. You can read about these differences here: https://en.support.wordpress.com/com-vs-org/

    You would need to reach out to the hosting provider for help in clearing that error.

  • Unknown's avatar

    Hello aleone89,

    Thanks for replying to my ticket, I thought this was a wordpress bug forum. Thanks for your time.

    I already contacted my server, but they don’t know about the error, that’s why I wrote you here. Let’s see how to solve it.

    Thanks, have a nice day.

  • The topic ‘Fatal error: Cannot redeclare use_block_editor_for_post’ is closed to new replies.