Questions tagged [add-submenu-page]

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

Filter by
Sorted by
Tagged with
81
votes
3answers
63k 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 ...
14
votes
4answers
31k 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 ...
11
votes
1answer
3k views

Check if add_menu_page exists or not

I'm working on a plugin that I have to release in parts. The problem is, if there is a menu in the page then add the new plugin to the 2nd or next submenu else add a new menu and then add the plugin ...
9
votes
1answer
6k views

Plugin - create a page without it appearing in the side menu

I am currently using add_submenu_page to add pages for my plugin. However, I wish to create a page that don't appear in the admin menu, is that possible?
7
votes
2answers
11k 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 '...
4
votes
4answers
15k 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', '...
4
votes
1answer
607 views

How to link a Custom Post Type submenu to a Nextgen Gallery page?

I've created a custom posts top level menu item but I would like to have a submenu under that linking to the Add Gallery page of Nextgen, as the client wants all their functionality bundled up under ...
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 ...
3
votes
2answers
10k 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 ...
3
votes
0answers
802 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, ...
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:
2
votes
3answers
6k 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: ...
2
votes
1answer
3k 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 ...
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-...
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 ...
2
votes
1answer
150 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 ) { $...
2
votes
1answer
4k views

add_submenu_page set for multiple roles [duplicate]

I have this string: add_submenu_page(basename(__file__), 'Events', 'Colloqui', 'subscriber', 'BW_events', 'BW_events'); How can I let this be available to editor(s) too? I tried ... ...
2
votes
2answers
3k views

add_submenu_page callback a file instead of a function?

I want to clean up my theme options because I can't keep track of everything. How can I get my page_callback to link to a file sintead of a callback? I know that I could include the file in the ...
2
votes
1answer
45 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, '...
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
3answers
5k views

How to add a child item to a menu element (using wp_nav_menu_objects)

(1) I used the code given on answer to How to use logout function on custom menu link? to programmatically add a menu element to wp_nav_menu_objects (Say "Animals"). I give it an id, say 1000. (2) ...
1
vote
3answers
1k views

Change top level menu item to point to custom submenu item

I'm using a plugin called CMS Page Order http://wordpress.org/extend/plugins/cms-page-order/ (Now referred to as CPO) It's pretty simple, the said plugin adds a new item to the submenu of every ...
1
vote
2answers
340 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
1answer
370 views

Odd behaviour with submenu link creation

I'm trying to develop a plugin that needs to add two pages to the dashboard side-bar menu. One of these being a main category. Everything is fine, except for the second submenu item for the settings ...
1
vote
1answer
592 views

Admin Panel - Custom Menu Sub-Item LINK

I'm trying to add a custom link under my Post Type in my admin menu, which will link to Pending Posts. This code functions, but it instead makes a page (like I suppose the function should), but I just ...
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 . ...
1
vote
1answer
2k views

add_sub_menu page() to be replaced by add_theme_page()

While checking my theme with theme-check plugin, i found few errors which are listed below along with the line of codes where it displays those errors(REQUIRED:) to be fixed. REQUIRED: plugin-...
1
vote
1answer
872 views

Wrong current class on admin menu with add_submenu_page()

I'm writing a plugin that displays a post/page list in the admin menu, as a submenu for each post type. Here's the code I've got far: http://pastebin.com/DmUGfzxN The lists are showing and linking ...
1
vote
1answer
169 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....
1
vote
0answers
99 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
436 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
1answer
187 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: ...
1
vote
1answer
131 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 ...
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
1answer
12k 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
1answer
79 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
3answers
1k views

Create dynamic wordrpess 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 ...
0
votes
1answer
1k views

How to add more than 1 user role to sub-menu pages

I create a plugin with 6 submenu pages. I need 4 of them to be accessible by administrator and a custom user role i created say 'coach' user. Then the 2 of them to be accessible by administrator and ...
0
votes
1answer
70 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 ...
0
votes
1answer
529 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
534 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....
0
votes
1answer
321 views

Prevent Admin gui output from page added using add_submenu_page

I have created a download link for my plugin using add_submenu_page. When the link is clicked it gathers some files into a zip, then outputs the contents to the browser like so: header('Content-Type: ...
0
votes
1answer
307 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 ...
0
votes
1answer
83 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 ...
0
votes
1answer
512 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/...
0
votes
1answer
636 views

Adding title and description to subpage's featured image

Hej! I have a subpage to display it's subpage featured image. I would like to add the title and description to beneath the thumbnail. Today my code look like this > In the functions.php function ...
0
votes
1answer
26 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
99 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 ...