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.

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
2answers
639 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 ...
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
1answer
185 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
1answer
25 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
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 ...
0
votes
1answer
208 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
382 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 ...
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
384 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
576 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 ...
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
1answer
168 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
388 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
1answer
37 views

Pricing Tables admin page capability

I'm creating a plugin that will allow to create Pricing Tables in a fast and easy way. But, I'm not sure what rule to use for capability. What would you use? Right now I'm using edit_pages: ...
-1
votes
1answer
521 views

TGM plugin error in Theme Check Plugin

Errors generated by theme-check plugin and with the code REQUIRED: plugin-activation.php. Themes should use add_theme_page() for adding admin pages. Line 335: add_submenu_page( add_submenu_page( ...
3
votes
0answers
785 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
vote
0answers
95 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 ...
1
vote
0answers
419 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 ...
1
vote
0answers
40 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 ...
1
vote
0answers
371 views

Add new button to WP backend menu

I can add a new link under the dashboard menu in the backend of WP function new_link_display() { echo "Echo html code for the page"; } function new_link_page() { if (function_exists('...
0
votes
0answers
77 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
53 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
0answers
237 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
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 ...
0
votes
0answers
298 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
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
0answers
193 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 );...