Register submenu on network menu from the subsite
Register submenu on network menu from the subsite
Register submenu on network menu from the subsite
Adding a submenu to the Tools menu returns tools.php in a popup box
Role capability issue
a loop is almost always a good solution to avoid to copy-paste code. you just need to use a array of datas like that : $submenus = [ [ “page_title” => “page1”, “menu_title” => “title1”, “slug” => “wp-admin.php”, ], [ “page_title” => “page2”, “menu_title” => “title2”, “slug” => “wp-login.php”, ], ]; foreach ($submenus as $value) … Read more
Problem with change url for all subpages (.htaccess)
I rewrote the code: /* Plugin Name: Admin Menu Post List Plugin URI: Description: Display a simple post list in admin menu for easy access Version: 0.2 Author: Eliot Akira Author URI: License: GPL2 */ /* * Load CSS in header */ function custom_post_list_view_css() { ?> <style> .post_list_view_headline { padding-left: 10px !important; padding-right: 10px !important; … Read more
I was using the same page name for both. You can see in this snippet that I used “BCRM” and I didn’t realize it. add_submenu_page( __FILE__, ‘BCRM Customer Settings’, ‘Customer Settings’, ‘administrator’, ‘**BCRM**’, ‘bcrm_customer_settings_page’); add_submenu_page( __FILE__, ‘BCRM Form Settings’, ‘Form Settings’, ‘administrator’, ‘**BCRM**’, ‘bcrm_form_settings_page’); I changed them to BCRM_customers and BCRM_forms respectively and it is … Read more
So to answear my own question after much googeling: In the args array I commented out the option for show_in_menu, so that custom post type creates the menu itself. Then I didn’t add the admin menu, but just the submenu (the hook still remains). add_action(‘admin_menu’,’bsp_plugin_menu’); And the first parameter is the one that shows it … Read more
I found the answer. To make it short: SOLUTION 1 If you want to simply add a custom post type to a menu item, go with solution number one (which involves creating a menu page with add_menu_pageand setting ‘show_in_menu=>’ to your menu page slug). It works, but if you click on your newly created menu … Read more
Insert the URL of the page as the $menu_slug argument. Also note that user levels are deprecated, you should pass a capability instead. function add_custom_link() { add_submenu_page( ‘edit.php?post_type=cpt_custom’, ”, ‘Pending Posts’, ‘edit_posts’, ‘edit.php?post_type=cpt_custom&post_status=pending’, ” ); } add_action(‘admin_menu’, ‘add_custom_link’);