Stack Exchange Network

Stack Exchange network consists of 175 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
1answer
24 views

Same ACF Relationship field for multiple Post Options sub-pages?

How can I ensure that the data saved by an Advanced Custom Fields Relationship field, when on an Options page for a Post type, is separate? Detail below: I have an ACF field group, “Features”, ...
0
votes
1answer
7 views

Admin menu hilighting wrong item for CPT

I have two admin submenu items for my custom post type, but only the first one, "General Settings", hilights when either submenu page is being viewed. add_submenu_page( 'edit.php?...
0
votes
0answers
63 views

How to pass data to shortcode via form

I have custom post type called "forms" and has a sub-menu page which has form, to add a name add_action('admin_menu', 'form_builder_add'); function form_builder_add() { //create new top-level ...
0
votes
0answers
42 views

How do I add a Gutenberg editor to a custom options page

Can I add a Gutenberg editor to a custom options page (admin submenu page)? How? I'd like to create a editor for a 404-page, but I'd prefer not to use a standard page for it since our clients might ...
0
votes
1answer
42 views

Change order of custom submenu link in WP Admin?

I've added a custom link to WP Admin under the Users menu, but trouble is I can't seem to get it to display above the default options. Is this possible? My code: // Add sub-menu option to users menu ...
2
votes
1answer
40 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
1answer
35 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
154 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
431 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
200 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
1answer
359 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 ...
2
votes
1answer
1k 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
19 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
511 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
9k 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
300 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
774 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
77 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
308 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
94 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
2answers
897 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
227 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
377 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
77 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
156 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
2k 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
408 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
39 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
6k 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
566 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
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 ...
2
votes
1answer
138 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
182 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
635 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
291 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
208 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
111 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
11k 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
727 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
4answers
1k 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
31 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
190 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
167 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
387 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
3answers
947 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
128 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 ...