Unable to customize the admin menu order

2019-09-04 22:38发布

I want to customize the menu order in wordpress dashboard. I used the following code and when i insert the page of my custom plugins it doesn't make to the order. any help would be appreciated.

 function custom_menu_order($menu_ord) {  
    if (!$menu_ord) return true;  

    return array(  
        'index.php', // Dashboard  
        'my_pludin_page.php',//my plugins home page
        'separator1', // First separator  
        'edit.php', // Posts  
        'upload.php', // Media  
        'link-manager.php', // Links  
        'edit.php?post_type=page', // Pages  
        'edit-comments.php', // Comments  
        'separator2', // Second separator  
        'themes.php', // Appearance  
        'plugins.php', // Plugins  
        'users.php', // Users  
        'tools.php', // Tools  
        'options-general.php', // Settings  
        'separator-last', // Last separator  
    );  
    }  
    add_filter('custom_menu_order', 'custom_menu_order');
    add_filter('menu_order', 'custom_menu_order');  

标签: php wordpress
1条回答
爷、活的狠高调
2楼-- · 2019-09-04 22:58
 add_filter('custom_menu_order', '__return_true'); // SET CUSTOMISE MENU ORDER TRUE
    add_filter('menu_order', 'custom_menu_order');  // CUSTOMISE YOUR MENU
查看更多
登录 后发表回答