Support » Plugin: New User Approve » getting error when opening theme customizer

  • acropora

    (@acropora)


    I get a weird error when opening theme customizer: Fatal error: Call to undefined function get_current_screen() wp-content/plugins/new-user-approve/includes/user-list.php on line 200

    on line 200 in php file it says : $screen = get_current_screen();

    How would i fix this?

    https://wordpress.org/plugins/new-user-approve/

Viewing 4 replies - 1 through 4 (of 4 total)
  • I was getting the same thing. Here’s how I fixed it.
    I commented out lines 201-204 in the /wpcontent/plugins/new-user-approve/includes/user-list.php

    If you are accessing the file via the GUI editor, edit the New User Approve plugin… and select file new-user-approve/includes/user-list.php
    Look for the filter_by_status function and comment out:

    $screen = get_current_screen();
    if ( isset( $screen ) && 'users' != $screen->id ) {
    return;
    }

    I am not able to recreate this bug. Perhaps it has been fixed on the WordPress side of things. Is anybody still seeing this problem?

    We are also experiencing this issue. Same error using WordPress 4.7. We did not have this issue prior to WP 4.7 so not sure what may have changed. Please help!

    I am still seeing this issue. It appears a plugin update had wiped out my comments that corrected the issue.
    I am running WP version 4.6.1, NUA version 1.7.4
    When in the Dashboard and go to Appearance > Customize I get the following error message:
    Fatal error: Call to undefined function get_current_screen() in [SITE_INFO_REDACTED]/wp-content/plugins/new-user-approve/includes/user-list.php on line 203
    The lines of code that I mentioned in a previous comment are found at the referenced location.
    A little digging brings me to the WordPress.org Function referene page:
    https://codex.wordpress.org/Function_Reference/get_current_screen

    As noted in the Usage Restrictions section:
    This function is defined on most admin pages, but not all. Thus there are cases where is_admin() will return true, but attempting to call get_current_screen() will result in a fatal error because it is not defined. One known example is wp-admin/customize.php.

    So, this function can not be called on this page.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘getting error when opening theme customizer’ is closed to new replies.