The error tells you what the problem is…
PHP Warning:
call_user_func_array()
expects parameter 1 to be a
valid callback, function …
Your “callback” isn’t a function. It is a file. It doesn’t work that way. You will need a helper function to include a file. Something like:
add_menu_page(
'Private Messages',
'Private Messages',
'manage_options',
'message_admin',
'include_message_admin',
get_bloginfo('stylesheet_directory').'/style/images/message.png'
);
function include_message_admin() {
// include('/path/to/message-admin.php');
// something like
include(get_template_directory().'/message-admin.php');
// or
include(get_stylesheet_directory().'/message-admin.php');
}
Related Posts:
- add_submenu_page not working
- Return value of add_menu_page
- add_menu_page with no link
- How to point “add_menu_page” to HTML file rather than PHP function
- Auto add (multiple) Custom Post Types to menu
- add_menu_page the children get url encoded prefix
- How is a widget supposed to reference what is added to custom submenu or addmenu fields?
- Highlighting admin submenu pages
- Not able to show the add_menu_page icon
- How to get data from option page [closed]
- usage of admin_url() in add_menu_page()
- add_menu_page() with different name for first submenu item
- do_shortcode() within Admin Page
- Show Custom Taxonomy Inside Custom Menu
- add_menu_page permissions – what am I doing wrong?
- Add custom page link with anchor
- How to remove duplicate link from add_menu_page
- How to use a WordPress’ existing admin icon?
- Adding an admin page – OOP approach not working
- The seventh parameter passed to add_submenu_page()
- Generate Advanced Custom Fields box in custom admin menu page
- Add highlighting to new Admin Dashboard Menu Item
- How to add a sub menu with AJAX?
- difference between add_object_page and add_menu_page
- Master menu item for multiple plugins?
- How to prevent parent admin page from appearring as a child admin page
- Admin Menus – Name Menu different from first Submenu [duplicate]
- add_menu_page() with function inside a class [duplicate]
- Enqueueing Scripts on a Custom Top-level Menu Page
- Settings page above CPT page in admin section
- How to change menu page capability
- How to avoid creating first submenu page that is same as menu page?
- add_page_menu to make shortcut to widgets
- Theme Options page not showing up in admin menu
- Why add_menu_page adds admin.php and how to remove it?
- Admin Dashboard with Custom Tab for Client
- Is there any way to add absolute path for add_menu_page function?
- add_menu_page() for more than one user role
- Where is the submitted $_POST array stored after an option page submission?
- Hiding Admin Page While Keeping Menu Expanded
- How to add custom menu item on plugin activation?
- Wp menu add page link as custom empty link
- Determine Registered Admin Menus
- Add submenus to Theme options menu
- Insert & order custom post types in/as submenu
- Adding subdomain to home_url for “add_menu_page”
- add_menu_page does not seem to work in a class
- how to open page, defined in plugin, from dashboad widget
- add_submenu_page function to show videos table
- Set different custom menu items for different user roles
- Check if Page Already Exists in Menu
- Able to edit custom post, but unable to create new custom post when within submenu. What capability is missing?
- Add menu option to “New Post” menu in admin bar
- Is there documentation reference for forms in menu and setting pages?
- How to add tags in Submenu page or Menu page
- Pagination in plugin’s backend
- Dynamic admin submenu
- Add a page in admin without adding menu item
- Add_menu_page() error message -> “You do not have sufficient permissions to access this page”
- How can I highlight a top level dashboard menu item created for a custom taxonomy?
- Custom plugin settings link doesn’t append current class to menu item when visited? Why?
- why add_menu_page use simple function as arg while add_meta_box a call back?
- Finding the screen id of a page generated with add_menu_page
- WordPress custom plugin gives error
- meta box on new admin page
- Add menu item to edit specific page
- Issue on Setting $icon_url Parameter on WP add_menu_page()
- WordPress add page under admin submenu and retaining the active status of the parent submenu page in the menu
- WordPress Settings API Repeatable fields
- Plugin add_action and add_menu_page
- add page to main menu (frontend)
- How can I create a new menu item that links to an archive of a custom post type?
- Show category and tag link as a submenu under custom post type submenu
- Adding submenu to custom plugin menu page created with add_menu_page() function
- Plugin page and capabilities
- add_menu_page() with variable function
- Add dashboard widget to page created with add_menu_page()?
- How to Call Specific .PHP file on add_submenu_page selection in Plugin Development?
- Custom admin menu order fails if slugs are complicated
- How to add styles to a submenu page?
- add sub_menu to a sub_menu (multiLevel sub_menu) in admin menu in wordpress
- WordPress Settings API Overrides My Previous Value
- only last option from theme options is being saved to the DB
- Multisite Setup – Menu Items To Reference Pages in Different Subdomains
- Highlight active Admin Menu when added though add_menu_page
- Add item to admin panel – w/o plugin & theme
- Create WordPress Menu Item Without Linking to a Custom Page
- How to create a custom menu for specific user
- add menu page in loop menu order
- How do I create a new directory to hold the assets for a new menu item?
- how to create pages and link them to a menu
- How to add a menu page for options in wordpress for user that has the role of vendor?
- Is it possible to have dynamic post id # in add_menu_page()?
- Pass custom css class to add_menu_page
- How to add admin bar only page?
- and custom post_types to custom menu
- Footer navigation menu
- Is it possible to add Custom Dashboard Widgets to Custom Admin Menu Page?
- Change default URL (or permalinks) in the back-end
- Multiple plugins settings of same developer into ONE settings page linked together