Call to undefined function get_current_screen()

[ad_1]

Found a bug:

PHP Fatal error: Uncaught Error: Call to undefined function get_current_screen() in …/wp-content/plugins/molongui-authorship/includes/hooks/post/query.php:6

Fixed it like so:

$current_screen_id = 0;
if ( function_exists( 'get_current_screen' ) )
{
  $current_screen = get_current_screen();
  $current_screen_id = $current_screen->id;
}

Then used $current_screen_id instead of $current_screen->id in the rest of the code.

Hope this helps.

Regards, Sander.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer