Tagged Questions

Add a top level menu page.

learn more… | top users | synonyms

1
vote
1answer
17 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, ...
0
votes
0answers
11 views

Make a menu link in Admin link to frontpage editor?

I have a page set up as my Frontpage. I'd like to have a link under the pages menu in the admin that says something along the lines of 'Edit Frontpage', which redirects to the editor or this specific ...
0
votes
1answer
92 views

Show custom taxonomy inside custom menu

I have a custom menu using add_menu_page: add_menu_page('My menu' , 'Some text', 'read', 'nwcm'); Under it, I show a custom post type menu item; // Create the news custom post type ...
0
votes
1answer
45 views

Add_menu_page() error message -> “You do not have sufficient permissions to access this page”

I'm currently building a website for a friend and have assigned him the user role of editor. I don't want to give him an administrator role in case he breaks the layout. Anyway, I am using ...
0
votes
0answers
26 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
42 views

add_menu_page does not seem to work in a class

Here is some of my code: class proposal { function __construct() { add_menu_page('Topic Proposal', 'Topic Proposal', 'read', 'topic_proposal', array(&$this, 'writer_page'), ...
0
votes
1answer
171 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
124 views

add_menu_page include a php page from theme directory

I have added some custom tables to a wordpress and trying to add wp-admin section to manage them. By using following code I have successfully added a menu item in wp-admin but I'm unable to call the ...
-2
votes
1answer
39 views

wp_nav_menu() doesn't assign proper class to elements and it forces wrapping the ul element

I'm having trouble with wp_nav_menu function. I want the menu to have no div wrapper; have the class sf-menu right for ul element of the menu and li elements not have any classes. I've tried many ...
0
votes
0answers
55 views

Load a template for add menu page

How to load a template from twentytwelve theme for add menu page function. add_action( 'admin_menu', 'register_my_custom_menu_page' ); function register_my_custom_menu_page(){ add_menu_page( 'custom ...
0
votes
1answer
83 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 ...
1
vote
0answers
89 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
276 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( ...
1
vote
2answers
432 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', ...
3
votes
1answer
2k 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 ...
0
votes
1answer
94 views

Pass custom css class to add_menu_page

My theme currently uses add_menu_page() in order to display the theme options sections on the left hand admin menu. I would like to be able to attach a parent css class to the main menu item in order ...
0
votes
1answer
74 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 ...
1
vote
2answers
121 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' ); ...
2
votes
2answers
6k 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 ); ...
1
vote
1answer
49 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 ...
19
votes
2answers
7k 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
2answers
135 views

How to add admin bar only page?

I successfully managed to create admin bar item using this: add_action('admin_bar_menu', 'toolbar_link_to_mypage', 999); function toolbar_link_to_mypage($wp_admin_bar){ global $wp_admin_bar; ...
0
votes
1answer
199 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')); } ...
5
votes
2answers
2k 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 ...
0
votes
2answers
663 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'), ...
1
vote
1answer
478 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 ...
0
votes
2answers
892 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 ...
3
votes
1answer
329 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', ...
1
vote
1answer
33 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();
3
votes
3answers
2k 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 ...
0
votes
2answers
512 views

Add submenus to Theme options menu

My theme currently has a single menu on the left hand sidebar of WP admin. I want to include submenus on that menu. How can I add, for example, a single submenu item to the "Theme Options" menu ...
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 ...
3
votes
1answer
746 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
672 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?
0
votes
2answers
444 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
2answers
157 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 ...
1
vote
1answer
482 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
3answers
850 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 ...
0
votes
2answers
149 views

and custom post_types to custom menu

managed to create a custom menu area in the admin but now want to place 2 post types to it. They already exist - questions & answers, but can't find a way to put their menu links into the custom ...
1
vote
1answer
151 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
2answers
449 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
128 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 ...
0
votes
1answer
415 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
1
vote
2answers
806 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 ...