add_action must be inside the plugin class and should look like
add_action( 'admin_menu', array( $this, 'add_menu_items' ) );
Usually this line presents in the __construct() method.
Related Posts:
- Set different custom menu items for different user roles
- Add a page in admin without adding menu item
- add_menu_page() with different name for first submenu item
- Passing arguments to a admin menu page callback?
- Admin settings update updating every time home page is hit?
- What’s the best method for emptying an option created with the Settings API?
- What is the recommended way to create plugin administration forms?
- How to add a new plugin page under desired Options page?
- Is it possible to add an admin page using add_submenu_page() and pass a var in the query string?
- Overwriting Core WordPress Functions with Plugins
- Naming Admin Menus and Submenus
- Current class on admin menu using add_submenu_page()
- Add Admin Menu Inside Construct or Init
- Master menu item for multiple plugins?
- Hook event for upload image in the menu
- Menu Error in Admin Console with Custom Plugin: You do not have sufficient permissions to access this page
- How to add Font Awesome 5 icons in WP Admin dashboard menu?
- How to put placeholder text in the main post input area?
- Unified Approach for Placing Option Pages
- Plugin with specific admin menu icon
- How to avoid creating first submenu page that is same as menu page?
- OOP Plugin and Menu – Call to undefined function register_setting()
- Global State During an Admin Post
- Howto: Use Custom Post Types as Submenu Items in Admin
- Sub Menu content is being duplicated
- Show/Hide ‘add new user’ custom fields in wordpress admin panel by click another field
- Bootstrap doesn’t work on admin menu page-How to override wp-admin style?
- is it recommended to use WP_List_Table?
- Plugin sub-menu pages recommended structure and links
- Is there documentation reference for forms in menu and setting pages?
- Creating Admin Plugin – Content of a page is displayed at global scope as well
- Silently register plugin pages
- WordPress theme options Menu
- Print Dashboard submenu name and filename
- Issue on Setting $icon_url Parameter on WP add_menu_page()
- I am trying to make a page in the admin section similar to the appearance of the Profile page for users
- Unable to get a simple plugin admin page to work
- Disable Auto-Expanding Menu in WordPress Admin Menus
- in_array function Problem
- Use options to control jQuery plugin
- Restrict certain actions to plugin-specific admin menu pages only
- Proper way to create an administration page without adding it to the menu
- Pause plugin option page until all data manipulation is complete
- How to add text editor in plugin menu?
- How to make an admin plugin menu page go full screen?
- How to add admin.php to WP Admin Menu Link
- add menu page in loop menu order
- Convert each new line in the textfield as a new value in an array
- How put the correct URL to sub-menu plugin?
- Developing a plugin where users can edit entries saved in database
- Add Admin menus or submenus depending on conditions
- Add a description/hint field in the admin page of a plugin
- Forcing ALL plugin Admin menus into a separate menu
- Link to a admin submenu item using a custom link
- Plugin admin list pages as submenu
- Change Admin menu placement using hooks
- Menu_slug used for creating options page
- How to design WooCommerce-like admin tabs for plugin settings page?
- Is it possible to add Custom Dashboard Widgets to Custom Admin Menu Page?
- Show Admin Menu
- Is there a way to decide from init whether we are on a certain backend page?
- adding an options menu that allows saving multiple sets of said options
- Admin adding submenu that has the same destination as the parent menu
- Plugin directory “Last Updated” not changed after initial commit?
- Fatal error: Call to undefined function wp_mail()
- Does WordPress have an Browser Agent?
- How Do I Load My Action Earlier Enough?
- I can’t find where a hook is being defined in a plugin – Easy Digital Downloads
- Filter on the_content ignores shortcodes
- Custom theme sufficient or custom plugin neccessary for this feature set?
- Add Submenu Link in add_submenu_page That Opens in a New Window
- How do I alter the position of a Custom Post Type menu item within my plugin admin menu?
- How to check if a stylesheet is already loaded?
- Plugin directory says that my plugin it’s not availabe in Spanish, but it is
- wp_editor add media button not working
- Plugin Development – Class Constructor Not Firing wp_enqueue_style action hook
- Alternative functions for mysql_free_result and mysql_ping in wordpress functions
- WordPress publish_post hook not getting featured image and meta on first publish, but works on updating title
- Add function after the_content
- How to add custom view links to wp-admin/post.php?
- How do I get variables from my plugin’s settings page?
- Get post thumbnail in WP_Query
- How To Protect Plugin Display From Being Affected By Theme’s CSS
- wp_schedule_event not executing function call, even with add_action
- Custom admin menu order fails if slugs are complicated
- How to query a nested field in wordpress api using _fields param
- function add custom fields to media gallery
- Add quick edit functionnality to plugin table
- using wordpress acf shortcods in tables goes outside the table
- $_SESSION inside php function executed by AJAX
- Two same AJAX calls – one is working, other doesn’t
- remove different admin menu for specific users
- add pagination to wp_remote_get
- Shortcode from a plugin not working
- How to get option values without requiring wp-load?
- Can’t get query string in ajax call
- WP Cron registers hook without any action (does not call the function)
- Fetch Custom Woocomerce filed data and check the data avialble in Wp-user table as nicname or username using function.php
- How to get locale within WP REST Request?
- How to add extra EXIF data when images are uploaded?