Add a top level menu page.

learn more… | top users | synonyms

28
votes
2answers
13k 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 ...
5
votes
2answers
3k views

do_shortcode() within Admin Page

I'm using a few plugins that have shortcodes ... however, instead of creating a public page for the content, I've created some new pages within the admin using add_menu_page and I need to know how to ...
4
votes
1answer
2k views

add_menu_page permissions - what am I doing wrong?

I am running a fresh install of Wordpress 3.3.2 and the only plugin enabled is one I'm developing, but I can't seem to get past a permissions issue in add_menu_page. With the exception of using ...
4
votes
1answer
114 views

What is the use of $page_title and how to use it?

I'm developing a WordPress plugin and added add_menu_page() but not sure what is the use of first parameter $page_title. If this is to use to display page title on the plugin page then how can I do ...
3
votes
1answer
3k views

Generate Advanced Custom Fields box in custom admin menu page

I have created an custom admin menu page called FCC Youtube with add_menu_page function which has some custom fields I manually generated via HTML and PHP: code ( just the part how I created this ...
3
votes
3answers
3k views

How to remove duplicate link from add_menu_page

In the theme admin menu below, the "MyTheme Menu Label" is being duplicated twice on the sidebar menu, once for the main menu link and again for the first submenu link. How can I remove the 2nd ...
3
votes
1answer
403 views

Add highlighting to new Admin Dashboard Menu Item

I have implemented a Custom menu item in my wordpress dashboard using the following command in the functions.php function create_menu() { $settings_page = add_menu_page('Edit_Post_69', ...
3
votes
1answer
991 views

How to add a sub menu with AJAX?

What i want to do is fire up the add_submenu_page() function from within ajax on my plugin options page. When i click an "Add League" link, i want to display an ajax input[text] that will save into ...
2
votes
1answer
29 views

Adding an admin page - OOP approach not working

I have a parent class, which contains the following: use app\My_Dashboard; class My_Class { public function __construct() { add_action('admin_menu', array($this, ...
2
votes
2answers
7k views

How to use a WordPress' existing admin icon?

I use the add_menu_page function to add an new admin menu: add_menu_page( 'Custom_menu', 'Custom_menu', 'edit_posts', 'custom_slug', '', 'wordpress_existing_icon', 5 ); ...
2
votes
1answer
141 views

Settings page above CPT page in admin section

I'm creating a plugin which generates a handfull or custom post types (CPT). I've create a top level menu in the admin left sidebar using add_menu_page(). I then added all CPTs to this menu using ...
2
votes
1answer
907 views

difference between add_object_page and add_menu_page

According to Codex, the add_object_page "essentially does the exact same thing as add_menu_page() in case you're wondering". So.... what is the difference between those two functions?
1
vote
2answers
755 views

Admin Menus - Name Menu different from first Submenu [duplicate]

I am creating a submenu with the following code: add_action( 'admin_menu', 'jp_create_admin_pages' ); function jp_create_admin_pages() { add_menu_page( 'Members', 'Members', ...
1
vote
4answers
1k views

How to prevent parent admin page from appearring as a child admin page

I am using this code: add_menu_page($page_title, $menu_title, $this->capability, $menu_slug, $function); Which is adding top level admin page. When I add: add_submenu_page( $menu_slug, 'sub ...
1
vote
2answers
931 views

Where is the submitted $_POST array stored after an option page submission?

What happens, when I click Save Changes on a option page, which was created by add_menu_page()? Where is the submitted data stored before the database transmission? A print_r($_REQUEST) returns only ...
1
vote
1answer
540 views

Associating custom submenu item with post type of top level menu item

I'm working on a plugin that sets admin menu submenu pages on all different post types. I need to be able to associate these new submenu pages with the corresponding post type of the top level menu ...
1
vote
2answers
164 views

Enqueueing Scripts on a Custom Top-level Menu Page

I've created a menu page using the following function: add_menu_page( 'Nonpareil options', 'Nonpareil options', 'administrator', 'nonpareil_theme_options', 'nonpareil_theme_display' ); ...
1
vote
1answer
34 views

Determine Registered Admin Menus

Is it possible to obtain a list of which Top Level Admin Menus have been registered via some plugin? I'm talking about menus registered with: add_menu_page();
1
vote
2answers
510 views

Return value of add_menu_page

I've read this on codex and seem some themes use it but never understood how it worked. (string) $hookname used internally to track menu page callbacks for outputting the page inside the global ...
1
vote
1answer
52 views

how to open page, defined in plugin, from dashboad widget

I have a plugin that adds a number of admin pages, and drives two page templates for the public facing documents. It also loads one dashboard widget for "subscribers". In this widget is a list of ...
1
vote
1answer
533 views

add_submenu_page function to show videos table

wondering if its possible to show the attachments admin list for videos by using a custom menu link? Any pointers welcome! D. add_action('admin_menu', 'mt_add_pages'); function mt_add_pages() { ...
1
vote
1answer
162 views

Master menu item for multiple plugins?

I guess this question is more or less about aesthetics and organization rather than functionality, but I'm curious nonetheless... I know I can add a custom menu item in the dashboard for my plugin ...
1
vote
1answer
553 views

Theme Options page not showing up in admin menu

I'm currently developing a WordPress theme and would like it to have a preferences pane in order to specify the user's Google Analytics tracking code for example. Following the instructions I got on ...
1
vote
1answer
132 views

Is there any way to add absolute path for add_menu_page function?

I am creating a plugin for add menu option to WordPress admin and using below function for that: <?php add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, ...
1
vote
0answers
107 views

How can I highlight a top level dashboard menu item created for a custom taxonomy?

I've used add_menu_page() to create a top-level dashboard menu item for a custom taxonomy. This is due to some specific needs with respect to this plugin. The menu item works fine, but when you ...
0
votes
1answer
460 views

why add_menu_page use simple function as arg while add_meta_box a call back?

I was looking on Wordpress function reference and find that add_menu_page takes simple function as arg while add_meta_box call it as call back. I am new to programming.. help me understand this
0
votes
1answer
728 views

wordpress 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 ...
0
votes
1answer
310 views

How to add custom menu item on plugin activation?

When my plugin is activated, I would like to add a new menu item. Here is my code: class My_Plugin { function __construct() { register_activation_hook(__FILE__, array($this, 'install')); } ...
0
votes
2answers
866 views

How to point “add_menu_page” to HTML file rather than PHP function

I added a new menu item for my plugin like this: add_menu_page( 'Control Panel', 'My Plugin', 'manage_options', 'control-panel', array($this, 'control_panel_page'), ...
0
votes
2answers
183 views

Seriously stuck with some custom meta box/plugin stuff

I’m working on a small plugin - part of it needs to add several meta boxes to all custom post types. I’ve tried looping through my array of custom port types in various ways but I keep getting errors ...
0
votes
1answer
22 views

Plugin page and capabilities

i´am developing my own WP plugin with custom functions and i would like to show the new submenu in the standard admin panel for everyone, who logs in. My code: $capa = 'administrator' or 'author' or ...
0
votes
1answer
65 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( ...
0
votes
1answer
190 views

Add menu item to edit specific page

I have pages setup and want a top level menu item to direct to editing a specific page. I'm reading through add_menu_page and it doesn't list how to get to specific pages or posts edit page. ie ...
0
votes
1answer
430 views

Issue on Setting $icon_url Parameter on WP add_menu_page()

I am trying to create a custom Menu by using the WordPress add_menu_page() function. I think I understand the whole function parameters as Codex point it out as: <?php add_menu_page( ...
0
votes
1answer
101 views

add_menu_page() with variable function

How can I use add_menu_page() functions some variable function ? add_menu_page('My page','My page','manage_options','my_page', 'func' ); $func = function() { echo "Done !"; }; I know I can ...
0
votes
2answers
1k views

How can I add/update post meta in a admin menu page?

I wanted to create a plugin to batch manage posts' custom field data. I know I can add post meta by add a meta box in post edit screen and use add_action('save_post','function_to_update_meta') to ...
0
votes
2answers
500 views

Add dashboard widget to page created with add_menu_page()?

I've created a standard page with a top level menu using add_menu_page() and I want to turn that page into a bespoke dashboard, ie to have a number of boxes like the dashboard widgets using something ...
0
votes
0answers
13 views

how to create page using add_menu_page?

how to create a new page in the administration menu, which will include (appearance -> header) and (Settings -> General) on one page?
0
votes
0answers
14 views

how to add a menu page with elements?

I have this example plugin for creating a page in the admin panel: add_action( 'admin_menu', 'register_my_custom_menu_page' ); function register_my_custom_menu_page(){ add_menu_page( 'custom ...
0
votes
1answer
23 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
14 views

Numeric values associated to admin menu bar

I'm customizing my admin left hand menu and am having an issue coming up with some of the numbers. I've even gone through the option of counting as I save out my code to confirm their sorting order ...
0
votes
0answers
22 views

Dynamic admin submenu

I'm creating a plugin for WordPress with dynamic sub-menu's fetched from the server. Putting the dynamic loading of sub-menu's into the menu_setup() hook function would slow down other WordPress ...
0
votes
2answers
50 views

Is it possible to have dynamic post id # in add_menu_page()?

I use the add_menu_page function in my custom theme builds but when I export my local copy of the site and import it in the production site some of post id numbers change and I have to update this ...
0
votes
1answer
17 views

Cloning admin pages like users.php

In my project I want to make a new menu position which will be actually a copy of 'Users' page but with some additional filters/modifications. For example as a result I need to have another menu ...
0
votes
0answers
93 views

Add custom page link with anchor

In my admin section I would like to add in Appearance > Menus > some custom pages to add to my menu. I have two different menu one for the home page and one for the others pages. In my home page menu ...
0
votes
1answer
73 views

Add a page in admin without adding menu item

In my plugin I have registered a menu_page; now I need another page. How can I add another page to my plugin without adding another menu item? Is it possible to call it by href?
0
votes
0answers
53 views

Wordpress theme-menu-page & siblings position

I'm registering theme menu page using following lines : add_menu_page(__('myTheme', 'myplugin'),__('myTheme', 'myplugin'), 'edit_posts','mytheme','my_plugin_dashboard', 'dashicons-forms', 30); ...
0
votes
0answers
138 views

Add custom menu link to Parent drop menu (Page Attributes)

if it possible to add custom menu link to parent drop menu in page? i am using custom menu link as parent item in menu (without really link). i have create this link using: Appearance -> Menus -> my ...
0
votes
2answers
148 views

add_menu_page with no link

I wanted to create an admin menu in WordPress that does not go to a page when you click it. The Menu would be as follows. Members <-- Top Level View Members Add Members "Members", the top level ...
0
votes
0answers
50 views

How to add a taxonomy into admin menu

I've added a admin menu by add_menu_page function. How can I add a taxonomy in this menu as a sub-menu? If it's impossible, How can I change layout of custom post type?