How to fix Call to undefined function Elementor\gutenberg_can edit_post_type() error

I got this error when I tried to access the Posts page from WordPress admin panel. First, WordPress returned blank pages and I was unable to find the error until I turned on debugging in the wp-config.php file.

To turn on debugging, modify the following lines in wp-config.php as shown below.

define('WP_DEBUG', true);
define( 'WP_DEBUG_DISPLAY', true);

Now, if you get the Call to undefined function Elementor\gutenberg can edit post_type() error when you try to Pages or Posts window, please follow the steps specified below to fix this issue.

Step 1

Go to wp-content->plugins->elementor->includes and open compatibility.php file.

Step 2

Search the following

// Gutenberg
if ( function_exists( 'gutenberg_init' ) ) {
add_action( 'admin_print_scripts-edit.php', [ CLASS, 'add_new_button_to_gutenberg' ], 11 );
}

and modify it as:

if ( function_exists( 'add_new_button_to_gutenberg' ) ) {
add_action( 'admin_print_scripts-edit.php', [ CLASS, 'add_new_button_to_gutenberg' ], 11 );
}

This should solve the issue.

If you enjoyed this post, let me know by leaving a comment below.


One thought on “How to fix Call to undefined function Elementor\gutenberg_can edit_post_type() error

Leave a Reply

Your email address will not be published.Required fields are marked *