• Please can you add in this quick fix for Notice: Trying to get property of non-object in /var/www/public_html/app/plugins/user-last-login/user-last-login.php on line 142.

    If you could change line 142 from
    if ( 'users' != $current_screen->id ) return;
    to
    if ( isset($current_screen) && 'users' != $current_screen->id ) return;

    Maybe add an is_admin() check there too.

    $current_screen won’t always be set so I’m getting this error in all sorts of places.

    Thanks

    https://www.ads-software.com/plugins/user-last-login/

Viewing 1 replies (of 1 total)
  • Richard

    (@richardcoffee)

    Trying to get property of non-object in plugins/user-last-login/user-last-login.php on line 147

    Still getting this error in 1.2. The rest api url of /wp-json/wp/v2/users generates this error. The $current_screen global will not be set in a rest api call.

Viewing 1 replies (of 1 total)
  • The topic ‘FIX for undefined $current_screen’ is closed to new replies.