• Resolved rogerlos

    (@rogerlos)


    At line 24 of admin-ui.php there is a require_once statement which doesn’t make sense and causes my dev box to crash.

    By the time the admin_menu action is called, via the add_action at line 28, admin.php has long since loaded…in fact, in the call trace, is the very first thing done. So there is nothing gained by trying to include it here.

    If you have reasons to need to load it that I cannot see (calling this function from outside of admin, somehow?), you should at least surround the require_once with a conditional to see if admin.php is already loaded:

    
    if ( ! defined( 'WP_ADMIN' ) ) { require_once ABSPATH . '/wp-admin/admin.php'; }
    

    (I believe by using require_once in a function, you’re short-circuiting the check to see if the file is, in fact, loaded, as PHP always tries to include files when the request is located inside a function. I think that’s what’s happening, anyway.)

    I see the notices when visiting any admin page access via the left admin menu which is not a standard WordPress admin page.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘geoip_detect_menu spawns notices in PHP’ is closed to new replies.