Using add_submenu_page()
, you can add submenus to your CPT's menu using 'edit.php?post_type=wpbp-backgrounds'
for your $parent_slug
parameter.
How to Hook into WordPress Custom Post Type Dashboard menu items
-
04-08-2022 - |
Question
I am working on a WordPress plugin that will use a Custom Post Type.
I have created the Post type the standard WP way using the register_post_type('wpbp-backgrounds', $args);
with the required args.
Creating the posts in this fashion creates the WP Dashboard menu items I need to access the new Custom Post.
The new menu I have is:
- WP Backgrounds
- Backgrounds
- Add New Background
What I would like to do is hook into this Dashboard menu and add a third item which I can link to the plugin settings page. The menu would look like this:
- WP Backgrounds
- Backgrounds
- Add New Background
- Settings
Is this something that is possible? Any help would be greatly appreciated.
La solution
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow