Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [add-submenu-page]

Adds a submenu page in the Admin section of your WordPress website.

0
votes
0answers
9 views

Linking plugin submenu links to PHP page

First time making a custom plugin so please go easy on me! I'm attempting to build a custom plugin with an admin panel. I have created the menu without too much trouble, but I'm now struggling to make ...
2
votes
1answer
26 views

How to avoid creating first submenu page that is same as menu page?

I've created menu page and four submenu pages. public function onixion_admin_menu_option() { add_menu_page('onixion','Onixion','manage_options','onixion-admin- menu',array(&$this, '...
0
votes
0answers
26 views

Automatically add and update submenu depending on parent pages

I would like to automatically populate sub menu depending on parent pages. I tried a good plugin called "Auto Submenu" but it does not automatically update the sub menu when we change the parent after ...
0
votes
1answer
28 views

How to have submenus collapsed until they are clicked?

I have couple of main admin menus and sub-menuse underneath them. Main menu1 Sub menu 1 sub menu 2 sub menu 3 Main menu2 Sub menu 1 sub menu 2 sub menu 3 Like ...
1
vote
1answer
84 views

add multipe sub menus using add_submenu_page

I need to add multiple submeus under a single parent admin menu. i can add submenu using following syntax. function register_my_sub_admin() { add_submenu_page( '/pluginname/includes/admin-menu....
0
votes
1answer
228 views

How to use add_submenu_page() for editors?

Currently I load a custom WooCommerce sub menu point in an own plugin like: // Add an additional submenupoint add_action('admin_menu', 'register_mycustom_menupoint'); function ...
0
votes
1answer
123 views

add submenu page doesn't display

I can't display the submenu of my menu when creating a plugin (Beginner). Could you please help me to find my error? My plugin is well activated and the menu_page appears well add_action('admin_menu',...
0
votes
0answers
10 views

Is it possible to use Settings API on a page generated by add_menu_page()

I want a fairly simple options page in my WP backend. It is just the one page, so only need to run add_menu_page(). In other words, I don't want to call add_submenu_page(). I know I can build the ...
0
votes
1answer
233 views

Admin submenu does not call function to load the page

Context I'm making a big plugin with a complex architecture. I would like in my plugin architecture split pages and menus building on admin side. So I have these classes : Menu.php, Submenu.php and ...
1
vote
1answer
824 views

How to give position to Submenu under custom post type

I am trying to add submenu under my custom post type and i succeeded also but it shows just under the post-type, i want to show it under the taxonomy. How to give a position to the newly created sub-...
0
votes
1answer
18 views

Create an administation subpage containing posts in a certain category

I have a website with 3 post-types. My boss wants to create an additional post-type containing only posts from a certain category. For example, I want all the posts under the category "important" to ...
0
votes
1answer
434 views

How to See Everything in get_option()?

In theme and plugin development I like to completely run through everything to make sure there are no issues and I'm not getting any errors. ONLY in development do I add the following in my footer....
2
votes
1answer
7k views

How to add custom submenu links in wp-admin menus?

Is it possible to add custom links as submenu on menu that already exist in wp-admin? Like for example, under appearance section like this:
0
votes
1answer
257 views

Show category and tag link as a submenu under custom post type submenu

I have created a college management menu in admin, under that i have added some sub menus those submenus are of different post types. Those were working fine. But Category and tags are not showing as ...
3
votes
0answers
669 views

How to change menu page capability

Is it possible to change the capability set for a menu page, previously added with add_menu_page()? I have a third plugin installed, that set a menu page created with a 'manage_options' capability, ...
0
votes
1answer
67 views

sub-page settings saving in NETWORK DASHBOARD

In single WP installations, on a plugin's generated sub-page, you put <form action="options.php" ... does the job well. However, in Multisite Network sub-page, options.php doesnt work, nor ...
1
vote
2answers
217 views

Hiding Admin Page While Keeping Menu Expanded

I am creating a custom admin section. I have the following code: // Top level menu add_menu_page('Books', 'Books', 'publish_posts', 'books', 'render_books_page', '', 17); // Adding this function to ...
0
votes
3answers
1k views

How can I add a sub menu to an existing navigation menu in WordPress?

I want to add submenu to a navigation menu in wordPress through code (not through admin panel) and I am totally new to Wordpress. Any help would be greatly appreciated! Thanks!
1
vote
0answers
85 views

Role capability issue

I have a custom sub menu item that has been setup for a long time and all of a sudden today one Role cannot see the item on the Tools menu. They can see a couple of other items on that same Tools menu ...
0
votes
1answer
611 views

Insert & order custom post types in/as submenu

TLDR: While in the backend, I would like to add custom post type inside a menu page (which I can do). But I cannot order the resulting submenu pages. I have 3 custom post types “A”, “B”, “C”, and I ...
0
votes
0answers
180 views

Can't save multiple sections on one page with register_setting

I try to write my first own theme but currently I struggle with making the options with the Settings API. My input values are just not saved and I don't know why. I read this tutorial from Tom ...
0
votes
1answer
341 views

How to keep the plugin submenu open on viewing a custom version of users.php?

I have added to my-plugin submenu a custom view of the user list using users.php and a my_plugin_view argument to filter the request: add_submenu_page( "my-plugin", '...
0
votes
1answer
66 views

How is a widget supposed to reference what is added to custom submenu or addmenu fields?

Stepping into advanced plugin development I've been following along with the Plugin Handbook but I did not see it mentioned how you're to reference what has been added to the settings page. So for ...
0
votes
0answers
125 views

Is it possible to use add_submenu_page() to add an item that's a link to edit another page?

I've recently discovered add_submenu_page and was pleased to be able to add my own page under a specific post type. I'm using a callback function to output some HTML directly /** * Display callback ...
0
votes
0answers
1k views

Adding a submenu to the Tools menu returns tools.php in a popup box

I am trying to add a submenu to the Tools menu. When the custom Tools sub-menu is chosen, I want it to call a function. That function will echo things out to the browser page that is loaded. My ...
1
vote
0answers
342 views

Register submenu on network menu from the subsite

I have a multisite like this: MainSite Site1 Site2 I want to register submenu page on active site in parent page /wp-admin/options-general.php on network in parent page /network/settings.php If ...
2
votes
1answer
33 views

How to change page via login as user and admin

I am using WordPress and I'm trying to develop eCommerce website using WooCommerce. When a user logs in I want to show the following in the menu-bar: Product Category Users profile Orders Cart Then,...
1
vote
0answers
38 views

Is there documentation reference for forms in menu and setting pages?

Trying to stick to WordPress best practices and improving how I do plugin development I have searched through the codex and developer documentation to see if there is anything indicating what is ...
2
votes
2answers
5k views

Add Settings to Custom Post Type

I have a custom post type called Portfolio. It is associated with three custom taxonomies. This is all working fine. For the archive page, however, I need to add a few custom settings. Due to a ...
0
votes
1answer
487 views

Adding Meta Box to Specific Submenu Page

I've created this page: function wpdocs_register_my_setting() { add_submenu_page( 'edit.php?post_type=task', 'View Tasks', 'View Tasks', 'manage_options', '...
0
votes
0answers
260 views

How to add a “tabbed” options page in Custom Post Type

does anybody has an idea of how to setup a "tabbed" options page in a custom post type. The options page is already there, done with the simple "add_submenu_page". But as it's getting too many ...
0
votes
1answer
1k views

Adding submenu to custom plugin menu page created with add_menu_page() function

I have created a custom menu page using add_menu_page() function. Everything in that page appears as it should in the screen. What I am trying to achieve is adding another submenu under the under the ...
3
votes
1answer
109 views

Programmatically adding menu items function replicates in multiple menus

I have the following code: add_filter( 'wp_nav_menu_objects', 'dynamically_add_shop_categories_to_submenu' ); function dynamically_add_shop_categories_to_submenu( $items ) { $...
1
vote
1answer
170 views

plugin admin subpage title and links in menu not highlited at current page

In my custom plugin subapges i want to echo their titles specifed in add_submenu_page() but i don't know how do that. This is part of code of my plugin which display links in left-side menu: ...
0
votes
2answers
580 views

Include script files for admin submenu page

I created a sub page to "users.php" where I can add a user in a customized way. I used a lot of the code from "user-new.php". However, user-new.php seems to rely on some javascript file to display the ...
0
votes
0answers
240 views

How to check an admin submenu already exists?

To check if a menu exists, I use this: if ( isset ( $GLOBALS['admin_page_hooks']['menu-slug'] ) ){} But it doesn't work with submenus. How can I do the same for submenus then? Thank you. EDIT: I ...
0
votes
1answer
196 views

Add Admin menus or submenus depending on conditions

I have two plugins in two different files that add a submenu (the plugin title) to the admin panel like this: Plugin 1: function myplugin1_setup_submenu(){ add_submenu_page("mybrand", "My ...
0
votes
0answers
105 views

Metabox on a custom page - How to include the appropriate default scripts and styles?

I have created a metabox on a CPT's submenu page created using add_meta_box. I see the metabox's style is not similar to the other metaboxes available on post edit pages. Moreover, the accordion type ...
0
votes
1answer
1k views

How to add a custom taxonomy to show up in a custom post type menu?

I really don't know hot to ask this question correctly. I've created a custom post type with a name badges and added custom taxonomies to it (level, skill). Now I want to add a new submenu item to ...
0
votes
1answer
10k views

Wordpress template - How to add class to li tag if submenu exist

for example i want create this menu: <div class="menu_wrap"> <ul class="nav sf-menu"> <li class="sub-menu"><a href="">Main Menu 1</a> <ul> <li>...
0
votes
2answers
682 views

What is the callback sent to add_submenu_page() invoked by WordPress?

WordPress tries to be event driven with all it's actions and filters you can hook to. But it also has special functions to create admin pages such as add_submenu_page() which accepts a (callback) $...
4
votes
3answers
941 views

add_submenu_page() link missing 'admin.php?' prefix

I have two plugins - one is the "primary" plugin called "SmartPost" and I'm trying to extend it with another plugin called "SmartPost E-mails". So, in other words, "SmartPost E-mails" extends and ...
0
votes
1answer
29 views

Post to type posts in subdirectory. [closed]

I would like to do the following: I have a blog with my domain www.examplesite.com and got some posts on it. But I would like to move some of the posts into a subdirectory www.examplesite.com/extras. ...
1
vote
1answer
54 views

Sub Menu content is being duplicated

In the plugin I am developing I am using the following code to build my menu - add_menu_page('BCRM Plugin Settings', 'BCRM', 'administrator', __FILE__, 'bcrm_settings_page', BOOGIE__PLUGIN_URL . ...
0
votes
0answers
167 views

Why is the Page Title missing on Pages added with add_submenu_page?

Adding sub menus is easy with add_submenu_page and is working fine as long if you define a $parent_slug: add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function );...
0
votes
1answer
145 views

Redirect loop when forwarding to mobile site

I have successfully redirected my page to m.example.com from example.com when i open in mobile environment with this code in functions.php add_action('template_redirect', 'redirecting_to_mobile_site'...
0
votes
1answer
377 views

Add a Submenu from Another Submenu in a Custom Theme

Good day everyone! I would like some help from you since I'm just a beginner in WordPress. I would like to add a submenu under another submenu like this: International China Independent Group Tours ...
0
votes
2answers
886 views

edit-tags.php in plugin admin menu hides when is the active page

For the plugin I'm building I have added a submenu as a child to a custom main menu item in admin. The submenu page is an edit-tags.php page. This shows up as intended under the main menu item. When ...
1
vote
1answer
116 views

Howto check version of another plugin and then add a submenu page to it

i'm writing a plugin which requires another plugin. So i have to check first if the other plugin exists in a correct version. If yes i want to add a submenu page to the plugin page but here my code ...
0
votes
1answer
460 views

Highlighting admin submenu pages

Here is my plugin's current menu/submenu structure: add_menu_page('Sunshine', 'Sunshine', 'sunshine_manage_options', 'sunshine_admin', 'sunshine_dashboard_display', plugins_url( 'assets/images/...