Articles of add menu page

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 item. Is this possible without having to rely on using $_GET? I see that $typenow is used on […]

Wp menu add page link as custom empty link

i’ve a problem with wp menu, in the admin panel when i try to add a new page link to menu it creates a custom empty link instead, everything was working fine until i installed qtransalte X, when i clicked savemenu every menu links were emptied and converted to custom links. Please help me

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 the two $_GET parameters page and settings-updated. I’ve checked the manual for add_settings_field and there is only the following hint: … the saving will be […]

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 menu 1’, ‘sub menu 1’, $this->capability, $menu_slug . ‘_sub_menu_page_1’, $function ); I get not only the desired child page, but also the parent page moves to become a child page of itself.

Admin Menus – Name Menu different from first Submenu

This question already has an answer here: add_menu_page() with different name for first submenu item 3 answers

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 I add the menu elements as link because I need to give […]

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 the Codex and multiple tutorials, this piece of code placed in the functions.php file should create a submenu of the ‘Appearence’ section […]

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 register_post_type()‘s show_in_menu option. I also created a plugin settings page using add_submenu_page(), which I also added to the top menu. […]

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, ‘setup_dashboard_page’)); } public function setup_dashboard_page() { My_Dashboard::add_dashboard_page(); } } And the class which has the admin page functions: class My_Dashboard { public static function add_dashboard_page() { add_menu_page(‘My Settings’, ‘My Settings’, ‘my-settings’, array($this, ‘dashboard_page_cb’)); } public […]

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 add a subpage item underneath this. I have read the codex and came up with: add_submenu_page( ‘woo-wholesale’, ‘Registrations’, ‘Registrations’, ‘manage_options’, ‘woo-wholesale-registrations’, ‘wwpr_page_call’ ); I am guessing this is incorrect as […]