Tagged: Admin Pages
- This topic has 5 replies, 2 voices, and was last updated 6 years ago by
efegue.
-
AuthorPosts
-
-
January 28, 2016 at 1:25 pm #5795
efegueMemberHello,
I’m creating a sub-menu admin page like this:
$pages[] = array( 'page_title' => __('Custom Settings') ,'menu_title' => __('Settings', 'piklist') ,'sub_menu' => 'plugin_parent_slug' ,'capability' => 'manage_options' ,'menu_slug' => 'my-plugin-settings' ,'setting' => 'plugin_settings' ,'menu_icon' => plugins_url('piklist/parts/img/piklist-icon.png') ,'page_icon' => plugins_url('piklist/parts/img/piklist-page-icon-32.png') ,'single_line' => true ,'default_tab' => 'Basic' ,'save_text' => 'Save Demo Settings' );The sub-menu is showing up correctly, the problem is that the menu link generated by this is wrong, it’s something like http://wordpress.dev/wp-admin/my-plugin-settings. It should be http://wordpress.dev/wp-admin/admin.php?page=my-plugin-settings, correct?
If I add it under let’s say “themes.php” submenu, it works perfectly, but in a custom admin_menu, it doesn’t.
-
January 28, 2016 at 1:34 pm #5796
efegueMemberLooks like this works if the main menu is a menu created with piklist admin pages. Cool.
Anyway, any chance to hide the “Main menu” from the submenu?
-
February 1, 2016 at 11:55 am #5817
-
February 1, 2016 at 12:17 pm #5822
efegueMemberLet’s call the main menu “My Plugin” and a submenu “Settings”, creating the menu turns out like this:
My Plugin
– My Plugin
– Settings -
February 1, 2016 at 12:31 pm #5823
SteveKeymasterThe built-in Piklist demos does this. Check out that code.
-
February 1, 2016 at 12:35 pm #5824
efegueMemberOk, will do. Thanks!
-
-
AuthorPosts
- The topic ‘Custom admin page for a plugin, menu_slug doesn't work.’ is closed to new replies.