Questions tagged [add-submenu-page]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
728 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
1 answer
1k 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”, ...
5 votes
4 answers
23k views

add_submenu_page not working

I have a built a plugin which creates a custom menu like this: add_menu_page( 'Wholesale Pricing', 'Wholesale', 'manage_options', 'woo-wholesale', 'woo_wholesale_page_call'); I am now trying to ...
1 vote
1 answer
2k 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 ...
5 votes
4 answers
3k 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
0 answers
35 views

Custom database table entry edit page

I can display every row of a custom DB table in my custom sub page, but I'm not sure how to implement a single row edit page. Is it as easy as verifying some link query parameter and then displaying &...
0 votes
4 answers
2k views

Create dynamic wordpress blank page

I've created a submenu in WordPress using add_submenu_page: add_submenu_page(null,'Page Title','Page Title','administrator','page-slug','page-callback'); I want to create another page like this with ...
127 votes
7 answers
107k views

add_menu_page() with different name for first submenu item

The add_menu_page documentation says to pass the menu title as the second parameter: add_menu_page('Page Title', 'Menu Title', ...); When adding more pages later via add_submenu_page, the main page ...
0 votes
0 answers
31 views

Add submenu page to a custom menu page

For a company project I'm fully customizing the wordpress wp-admin dashboard to be the front end after an user is logged in. I need to hide the admin bar for non admin users and add a submenù to a ...
3 votes
2 answers
15k 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 ...
10 votes
3 answers
20k views

Add an admin page, but don't show it on the admin menu

I have a custom plugin 'Charts' that has it's own menu. In that menu are links to the 3 pages for the plugin - 'Charts', 'Add Chart' and 'Edit Chart'. However, I don't want to display the link to '...
0 votes
4 answers
2k 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 ...
0 votes
0 answers
16 views

Multiple plugins settings of same developer into ONE settings page linked together

Im quite new to wordpress and plugins. I'm still a student so im still in the learning curve. Thank you in advance for reading my question CONTEXT Each plugin is a plugin on its own but made by the ...
4 votes
1 answer
2k 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, ...
-1 votes
2 answers
1k views

Error on add_submenu_page() declaration

Was called incorrectly. The seventh parameter passed to an add_submenu_page() should be an integer representing menu position. Please see Debugging in WordPress for more information. (This message was ...
-1 votes
1 answer
1k 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', '...
1 vote
3 answers
5k 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 ...
2 votes
1 answer
269 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
1 answer
220 views

Two e-commerce in two different folders of the same domain

I need to create two e-commerce with woocommerce, one in the main directory of my site in Italian and English for online sales in Europe, and one in a subfolder or subdirectory exclusive for ...
0 votes
0 answers
293 views

How to Call Specific .PHP file on add_submenu_page selection in Plugin Development?

I want to structure my Plugin folder & file system in a way, where in add_submenu_page when I will click on my sub menu link it will call separate .php file where i will car specific function ...
0 votes
1 answer
38 views

add_submenu_page() issue

I am trying to add a Menu in WordPress Admin Panel. I am using below code. This code is working. add_submenu_page('weather_info', 'Weather Information', 'Weathers', 'manage_options', 'weathers', [$...
2 votes
1 answer
385 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
1 answer
230 views

How to hide plugin submenu title in drop down in admin panel in wordpress?

I have created a plugin that has some sub menus i.e add new & list, besides that I also have pages to update the data, But I don't want to display these sub menus in dropdown. Here is my code. ...
0 votes
1 answer
29 views

Why won't this submenu page show? - My First WordPress Plugin

Starting to build my first plugin and I'm completely puzzled on why the submenu page won't show? The main page shows up, not the subpage. I've run over the syntax what feels like a million times and I ...
2 votes
3 answers
2k 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 ...
1 vote
1 answer
127 views

Visiting a console submenu page does not expand its parent menu item

*I have moved a custom post taxonomy to another menu item //created a post type that does not appear in admin menu, therefore its taxonomy does not, too $args = array( 'label' ...
1 vote
1 answer
935 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',...
4 votes
3 answers
9k views

How to create sub menu with a URL parameter?

I would like to add parameter for the submenus, but when I click to the admin page I receive the following message: You do not have sufficient permissions to access this page. Code: ...
0 votes
0 answers
154 views

How to create a custom post-new.php page for plugin , no wp menu

I am currently creating an administrator plugin to manage and edit a large amount of separate information about establishments. I recreated a page with the list of articles which is linked to a new ...
0 votes
1 answer
243 views

How to add styles to a submenu page?

I'm relatively new to WordPress and, I am creating this plugin, where I need a submenu page. I have successfully created the main page and have added CSS to it without any problems. However, I came to ...
3 votes
4 answers
11k views

The seventh parameter passed to add_submenu_page()

I'm testing WordPress 5.3 (5.3-RC4-46673) with my theme. I have WP_DEBUG enabled. I notice the following error in the dashboard now: Notice: add_submenu_page was called incorrectly. The seventh ...
1 vote
1 answer
2k 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 ...
0 votes
0 answers
145 views

How to remove empty menu space when creating admin page without menu title using add_submenu_page

I have added few pages to handle edit, view page that is should not be accessed from wp-admin navigation menu and its a success. But now on my menu, I have empty space as sub-menu. Below are my codes ...
2 votes
2 answers
4k views

Hooking into add_submenu_page

Ever come across a plugin that is using the manage_options capability for a page that... really doesn't need to be? Well, I've come across just that. This may be more of a general question about ...
1 vote
0 answers
46 views

Problem with change url for all subpages (.htaccess)

Im looking for someone who will knowing the main code I have subpages with ugly names http://grimlord.eu/index_pl.php?src=home How cut it for this url grimlord.eu/start Pls tell me how? RewriteCond %{...
3 votes
2 answers
18k views

Menu capability in Wordpress

Is it possible to specify two usergroups (e.g. admins and editors) into the admin menu capability field ? I tried the following but it doesnt work: add_submenu_page( 'my-top-level-handle', '...
0 votes
2 answers
344 views

Wordpress add page under admin submenu and retaining the active status of the parent submenu page in the menu

I have added a page in the admin menu(pxmag-menu) and a submenu(pxmag-plans). There is another page(pxmag-plans-edit) set under the submenu(pxmag-plans) as the parent page. public function __construct(...
0 votes
1 answer
311 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 ...
6 votes
5 answers
24k views

Add menu and submenu in admin with a URL instead of slug?

I use this function and hook: function mysite_admin_menu() { add_menu_page( 'Categories', 'Catégories', 'administrator', 'categories', 'a_function' ); add_submenu_page( 'categories', 'Manage', '...
0 votes
0 answers
81 views

Bootstrap Theme Migrated to WordPress

Looking for your expertise, as I'm fairly new using WordPress and I'm in the process of migrating bootstrap theme into it. Problem: I have a navigation menu in the header and want to have a ...
0 votes
2 answers
1k 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
1 answer
1k views

Add a custom submenu under submenu in a Custom Wordpress Plugin

I know how to add custom menus and submenus for the custom plugin. But for creating another submenu under submenu is what I cannot figure out. What I have: Plugin-Main-Menu Add Update Event What I ...
1 vote
0 answers
849 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 ...
0 votes
2 answers
1k views

What's the correct way of moving a menu page to a submenu

In one of my client sites, the default comment feature is not needed globally. Instead I'm using it only under a certain CPT (eg. Complaints). With the following code, I moved the parent menu item: "...
22 votes
4 answers
56k views

How to Add a Sub Menu Page to a Custom Post Type?

I am trying to create a sub-menu under a Custom Post Type I have named Portfolios. When I change add_submenu_page() to add_options_page(), it correctly shows a new link under the Settings menu, but ...
0 votes
1 answer
582 views

Menu with sub-items but without link

while using WP you can change your main menu pretty easy. Still, when I want to create a new menu button, I have to give it a link to some article, category etc. Is there a way to avoid it? In ...
0 votes
1 answer
75 views

Submenu Page under Settings in Admin Panel

I have a quick question, I am wanting to add in a new submenu to the 'Tools' section on my Admin Panel but without modifying any of the original WordPress files such as (functions.php, etc..) files. ...
0 votes
1 answer
414 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
1 answer
20 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
1 answer
890 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 ...