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 to get inserted row IDs for bulk/batch insert with wpdb query?
- Override woocommerce loop-start.php from theme using plugin?
- Get value of custom checkbox from Gutenberg sidebar in plugin
- setTimeout not working in jquery
- Getting products information, in woocommerce based on products ID
- Enable a role named ‘backend_user’ to access my plugin pages
- I’m including a html file in my plugin, but it can’t find its css or js files
- Save meta box data from selected dropdown list in bbpress reply form
- get the term_id of current taxonomy page
- how to handle premium features in a wordpress plugin?
- Sanitize WordPress Array Input?
- How to know if current plugin is going to be used while rendering the page?
- How the add_action is included in the plugin development
- Dynamically modify content added to table via javascript
- Disabling Yoast, All-in-One, and Rank Math on Certain Pages within a Plugin
- How to show content in the body with my plugin (only in frontend not backend)?
- Show username only if logged in in a else no directly name
- Metabox types list
- How to limit number of category term display in home page grids?
- how to create a shortcode from a variable in plugin
- Conditionally check if page is using template from plugin directory
- plugin css is not being applied to the page
- How to direct WordPress to load custom template for custom post type
- Any way, hook to add content right before the “read more” link?
- A question on init and activation hooks
- get_the_tags doesn’t works?
- Is it possible to develop themes and plugins locally while still allowing content to be updated directly in the admin dashboard?
- Is there any way to get post meta from publish_post hook?
- How do I specify where to save the debug.log?
- Dont display post with no content
- Custom User Role Preview Function Not Working
- get_the_date() returns english Year & Day when language is Arabic
- Where to save Gutenberg plugin data?
- WP_Fatal_Error_Handler OR WP_Error OR try/catch
- Why does do_action pass a blank string as the first parameter if no $arg is set?
- WordPress how do I echo SUM from a column of a MySQL table by user id AND type_operation
- Custom table / Alternative to WP_List_Table
- Quick Draft widget (dashboard.php) using custom post_type
- Buddypress: adding a new tab direct user to their author page
- Add a custom submenu under submenu in a Custom WordPress Plugin
- Why is that only the first row getting inserted into Mysql table when i import csv file on backend custom plugin?
- Why would one specify multiple arguments when using get_previous_posts_link() which takes only one parameter?
- WordPress Jquery with heade and footer sritp plugin
- Adding External Gmap JS to WordPress
- Adding Amchart Interface to WordPress API
- ajax response strips multidimensional array and unable to decode
- PHPUnit Testing and woocommerce Constant
- I cant add is_admin control to plugin
- Unit Testing action hook
- Redirect WooCommerce checkout to cart
- First page download plugin
- WordPress Query doesn’t return the correct value
- WordPress Own Rewrite Rules
- 400 Bad Request and illegal invocation in wp_ajax based on processData set to false or true
- Uncaught Error: Call to undefined function wp_get_current_user() in
- Default media uploader is not showing in wordpress website
- Load script on frontend from widget plugin
- why is update_user_meta creating arrays when trying to change the same value?
- delete category on plugin deactivation wordpress
- How do I show how many products are remaining from the bought package
- Rate limiting ajax requests in WordPress
- Delete Plugin Options with Verify
- WordPress Ajax not returning Response
- ajax-action.php can’t find added action
- Events Manager: Create custom Placeholder for use in Email notification
- WC REST API Error Handling
- How to hide/remvoe unnecessary field/section in post edit section ( Dashboard )
- Fatal error: Uncaught Error: Using $this when not in object context
- functions won’t fire after I converted my code from procedural code to OOP
- Custom non-template page on front end fails to render
- Add custom parameter for custom user role
- Shortcode content is not showing. Only the [shortcode-tag] is showing
- Post is uncatagorized in publish_post action
- get_queried_object_id combined with wp_redirect gets wrong id
- Stuck on a 504 error
- When does global/main code of plug execute?
- Using WordPress Boilerplate (WPBP) for WP Multisite Plugin
- How to prevent wp_insert_post from creating a new post every second?
- Error Connecting to Database WHEN Installing WordPress on XAMPP [Tried All the Usual Stuff] (Pics Included)