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
- How to include jQuery and JavaScript files correctly?
- How do I log plugin (cron) actions?
- Adding pre-publish checks with Gutenberg
- How Do I Make WordPress Run an Event Every Day?
- How to add SQL file with PHP to WordPress database [closed]
- How can I free up the memory used by update_post_meta?
- add javascript button to order place button
- How to register activation and deactivation hook in plugin using OOP pattern
- Show dialog box in TinyMCE plugin and use WordPress php functions in it
- PHP 7 – Class Method Compatibility Issue
- Change reset password URL returned by wp_lostpassword_url() via plugin
- How to print raw query from WP_Query class just like in CodeIgniter
- Hiding Admin Page While Keeping Menu Expanded
- dbDelta() Error – Incorrect index name ” for query ALTER TABLE
- Is it safe to call do_action and apply_filters for built-in hooks?
- Creating a Link Text like Submit Button in Admin Page
- 403 Error when text is pasted in Custom Metabox Textarea
- Multiple Plugin best practice in Multisite
- How to extend WooCommerce API to show bookable product availability rules?
- WordPress allows multiple users to have same email ID; and I’ve a problem with it!
- Enumerating shortcode attributes in JavaScript
- Delist entries in the_loop
- wordpress add_submenu_page adds broken link
- WP Enqueue style on all plug-in pages
- Can we use a library under MIT license in a WooCommerce plugin?
- Why does comments_open() return false when publishing a scheduled post?
- Including template in shortcodes
- How to exclude categories from get_categories() select list inside a widget admin panel
- WordPress plugin development theme issue
- Securing custom rest API endpoints with public access from PWA
- By adding “?login – failed” code unable to access my dashboard
- How to prevent users from deleting their accounts?
- Is it possible to restore an expired transient?
- How to Maintain url on form submit
- Experts opinions needed: How (in)secure is this approach?
- add_option_{$option} action hook not being called
- how can I insert a link on login page
- Shortcode attribute “title” doesn’t appear in $atts array
- How will i add an option under customizer the event calendar section?
- Return custom product in ajax call loop