You’re using the admin_init
hook to add menus – use admin_menu
instead.
The init hook runs early enough for wp-admin/menu.php
to add it to the sidebar menu, but not for the plugin page loading in wp-admin/admin.php
In other words, when you actually try to load the plugin page, your menu code hasn’t fired and WordPress fails with that rather generic error.
Related Posts:
- Add Custom User Capabilities Before or After the Custom User Role has Been Added?
- You do not have sufficient permissions to access this page on a submenu
- insufficient permissions; coding an action for plugin governed by custom capability
- How do I create a custom role capability?
- what’s the meaning of the field wp_capabilities in table wp_usermeta
- Export data as CSV in back end with proper HTTP headers
- How to Structure a New Role/Capability Scheme?
- Odd behaviour with submenu link creation
- How to allow Unfiltered HTML in a wordpress multisite install
- Limit role to one plugin [duplicate]
- Failed to Open Stream: Permission Denied While Writing to an XML File in a WordPress Plugin
- Logout users upon login, based on caps/role?
- Create a custom capability to allow an ‘Editor’ to edit only ‘Subscriber’ users
- Menu page with minimum capability as ‘Subscriber’ doesn’t allow ‘Admin’ to access it?
- How to use gettext for specific user role
- How to determine which capability to use?
- Allow contributor user role to perform copy operation PHP
- Buddy Press restrict the capability to edit users
- Remove Custom Capability
- What is more secure checking capabilities of user or checking role of user in WordPress plugin development
- Plugin capabilities
- How do I add CSS options to my plugin without using inline styles?
- How to override existing plugin action with new action
- Add custom TinyMCE 4 Button, Usable since WordPress 3.9-beta1
- How to store username and password to API in wordpress option DB?
- How do I create links at the top of WP_List_table?
- Is it worth checking if class_exists when developing a plugin and how to do it?
- Why Does get_posts() Return an Empty Set?
- Get list of available wordpress actions
- Where to enqueue stylesheets for plugin?
- How can the tinyMCE dom be manipulated (offical API does not seem to work)?
- stray elements
- Deletion of shared options using uninstall.php
- Pass javascript result to shortcode executer function
- Plugin Settings not Saving on Ajax re-ordered table
- Can we create a category list page in WordPress?
- Undefined function wp_set_password
- WordPress password reset – why post rp_key?
- How to modify the new WordPress 4.5 link inline toolbar
- Proper way to hook wp_get_attachment_url
- How to install WordPress Popular Posts plugin twice?
- Get the link text
- Multisite plugin development and wp_enqueue_script
- Prevent plugin from deleting important directories
- Default category got deleted. How to get it back as ID=1?
- Is Dreamweaver CS5 a serious choice for theme/plugin development?
- What allows a template file from plugin to be copied in child theme and overridden?
- How to set “Site Address (URL)” programmatically on WP multisite?
- creating custom archive template within plugin for custom post type using archive_template filter
- Reset plugins version cache | pre_set_site_transient_update_plugins
- Add column and post filter for a custom post type field on the edit.php page
- Trying to understand order and frequency of action hooks firing
- Roles for Custom Post Types
- Create & Save multiple Meta-boxes
- How to fetch all images from a WordPress draft using PHP?
- Can’t get woocommerce_get_price_html to work [closed]
- jQuery selectors for editor elements safe to use?
- parse content from wikipedia article replacing search term with the title of article
- Fatal error: Uncaught Error: Call to undefined function get_option()
- Strange Situation When Try To Retrieve Github Gist Using wp_remote_get
- Thickbox doesn’t respect dimensions when used in admin [duplicate]
- jQuery does not enqueue for my purpose… (before an inline script in the footer)
- Can I add custom css to an mu-plugin?
- Change WooCommerce Email Header using custom plugin
- WP Plugin Running before jQuery
- Prevent WordPress automatically processing certain URL queries
- insert query on a custom table using ajax with jQuery plugin Jeditable
- WordPress multisite,use same cookies across all website?
- How to check via conditional tags for a single plugin page?
- How to add search form in main page body?
- How to save post meta as an array in Gutenberg?
- WordPress Rest API with rest_do_request, possible race condition?
- Need help about understand api, wp, $ syntax in WordPress plugin script
- How to disable a jQuery plugin on WordPress plugin page
- Is it possible to use WP-CLI in a plugin (or theme)?
- Get section of input passed to the sanitize_callback
- Checking for existing title in custom db query not working
- Many Single Sites, One Plugin directory – adjust plugins_url()
- My plugin creates custom widgets, How can I programatically add them to existing sidebar widget areas?
- Custom Endpoint – Does it possible to use PUT method with WP API Rest?
- How to know if current plugin is going to be used while rendering the page?
- Dynamically modify content added to table via javascript
- functions won’t fire after I converted my code from procedural code to OOP
- How to prevent wp_insert_post from creating a new post every second?
- CPT UI and custom database table
- Updating a WP Plugin SVN not showing on WordPress Website or Zip
- Download stopped working in 4.7.4
- $wpdb Mysql trigger problem
- edit-tags.php in plugin admin menu hides when is the active page
- WordPress postboxes On Tabbed Views and Hiding Registered Pages
- grouping my widgets wordpress
- Yet another wp_insert_post infinite loop. What is wrong?
- Initialize class inside plugin
- Why does this fail: Disabling plugins enqueue_script() in functions.php
- “Print to printer” functionality in a plugin
- Remove text from confirmation message
- Which subset of html does WordPress support?
- Can I use an array to create multiple tables?
- How to set init for maximum script execution, memory limit and max files upload in wordpress
- Display months on a drop down calendar as TEXT instead of Numbers