• Resolved SeanBanksBliss

    (@seanbanksbliss)


    Fatal error: Call to undefined function get_current_screen() in /wp-content/plugins/inclusive-parents/inclusive-parents.php on line 94

    This happens when I click the “Customize” button (for theme customization).

    It also happens when installing some other plugins from time to time.

Viewing 2 replies - 1 through 2 (of 2 total)
  • To avoid this it needs to check if the get_current_screen function actually exists since it isn’t defined in all contexts (theme customization is the main one). So in my copy I’ve updated line 75 to:

    if ( is_admin() && function_exists('get_current_screen') && get_current_screen() && 'nav-menus' == get_current_screen()->base ) {

    and line 94 to

    if ( is_admin() && $query->is_main_query() && function_exists('get_current_screen') && 'nav-menus' == get_current_screen()->base ) {

    I have a pull request open on GitHub to fix this issue. Any chance of getting that merged?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Fatal error: Call to undefined function get_current_screen() on line 94’ is closed to new replies.