Add Admin Menu Inside Construct or Init

The callback you have given in add_menu_page() is a static function, not a class method. It should be:

add_menu_page( 
    'School Manager Settings', 
    'School Manager', 
    'administrator', 
    'school-manager-settings', 
    array ( $this, 'show_admin_settings_page' )
);

And please don’t use &$this anymore, that’s PHP 4. 🙂

My demo plugin T5 Admin Menu Demo might help understanding how that works.

Leave a Comment