我想在我的 wordpress 管理仪表板中重新排列菜单顺序并尝试了以下代码。但未能成功。在我使用的代码下方。我在functions.php 页面中使用了它们。
function enable_custom_menu_order() {
return true;
}
function custom_menu_order() {
//return array('edit.php','shashopping.php', 'edit-comments.php','index.php' );
return array(
'admin.php?page=my_plugin_page.php', //my plugin page
'tools.php', // Tools
'index.php', // Dashboard
'separator1', // First separator
'admin.php',
'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
'options-general.php', // Settings
'separator-last', // Last separator
);
}
add_filter( 'custom_menu_order', 'enable_custom_menu_order' );
add_filter( 'menu_order', 'custom_menu_order' );