WordPress.org

Ready to get started?Download WordPress

Forums

Lockdown WP Admin
Fatal error when going to /wp-admin (5 posts)

  1. HCE
    Blocked
    Posted 1 year ago #

    When using this plugin to hide the backend, going to /wp-admin generates a 404, as it's suppose to, but it also generates this error message at the bottom of the page:

    "Fatal error: Call to undefined function get_current_screen() in /home/username/public_html/wp-includes/admin-bar.php on line 426"

    I've seen lots of people complain about this, but the plugin author has failed to offer any resolve. It would be nice if he got off of Twitter and finally addressed this issue. What is causing this error and how do we fix it?

    Also, on another site, it generates this error message at the top of the page:

    Warning: call_user_func() expects parameter 1 to be a valid callback, class 'ThemeSite' not found in /home/username/public_html/wp-content/themes/nameoftheme/header.php on line 192

    Warning: call_user_func() expects parameter 1 to be a valid callback, class 'ThemeSite' not found in /home/username/public_html/wp-content/themes/nameoftheme/header.php on line 198

    What is causing those errors and how do I fix them?

    http://wordpress.org/extend/plugins/lockdown-wp-admin/

  2. alekc
    Member
    Posted 1 year ago #

    We had the same issue. Try the following fix:

    Open file lockdown-wp-admin.php, and add after
    // Handle the admin bar following (should be around row 606)

    this row
    require_once(ABSPATH . "wp-admin/includes/screen.php");
    so in the end you should have this code

    .....
    status_header(404);
    		$four_tpl = get_404_template();
    
    		// Handle the admin bar
            require_once(ABSPATH . "wp-admin/includes/screen.php");
    		@define('APP_REQUEST', TRUE);
    .....

    This is a fix for error
    Fatal error: Call to undefined function get_current_screen() in /home/username/public_html/wp-includes/admin-bar.php on line 426"

  3. Sean Fisher
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    Just updated 2.0 to handle the admin bar and 404 page handling a little bit better. Try that out.

  4. dpanitz
    Member
    Posted 1 year ago #

    When logged out and going directly to /wp-admin, I get a blank page with the following source code:

    <!DOCTYPE html>
    <!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en-US"> <![endif]-->
    <!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8" lang="en-US"> <![endif]-->
    <!--[if IE 8]>         <html class="no-js lt-ie9" lang="en-US"> <![endif]-->
    <!--[if gt IE 8]><!--> <html class="no-js" lang="en-US"> <!--<![endif]-->
    <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title><br />
    <b>Fatal error</b>:  Call to undefined function  theme_generator() in <b>/home/user/mysite/wp-content/themes/striking/header.php</b> on line <b>17</b><br />

    Anyone know how to fix this?

  5. HCE
    Blocked
    Posted 1 year ago #

    Thanks, alekc! That worked. I reaaly appreciate your efforts.

    Sean - I updated to the latest version but I'm still getting these error messages when I go to /wp-admin:

    Warning: call_user_func() expects parameter 1 to be a valid callback, class 'RTThemeSite' not found in /home/username/public_html/wp-content/themes/themename/header.php on line 192

    Warning: call_user_func() expects parameter 1 to be a valid callback, class 'RTThemeSite' not found in /home/username/public_html/wp-content/themes/themename/header.php on line 198

    Also, when I go to /wp-login.php it renders the login page. I selected to block that by renaming it to /login. But now I can access the login page on both /wp-login.php and /login. /wp-login.php should go to a 404 page. How can I ensure this?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic