I am trying to implement the solution provided by the correct answer to this Question:
https://wordpress.stackexchange.com/a/276249/111198
I have a LOT of plugins, and CPT's going on, as well as Avada theme installed. I'm running the latest version of everything:
I've first built out the array exactly as the menu appears in my admin panel:
//Rearrange the admin section
function wpse_custom_menu_order( $menu_ord ) {
if (!$menu_ord) return true;
return array(
'index.php', // Dashboard
'activity_log_page', //Activity Log
'avada', //Avada
'fusion-builder-options', //Fusion Builder Options
'edit.php?post_type=slide', //Fusion Slider Post Type
'separator1', // First separator
'edit.php', // Posts
'edit.php?post_type=eguide_article', //eGUIDE Articles CPT
'edit.php?post_type=webinars', //Webinars CPT
'edit.php?post_type=tribe_events', //Tribe Events
'edit.php?post_type=vendors', //Products & Services Directory
'upload.php', // Media
'edit.php?post_type=associations', //Associations & Organizations Directory
'quick-featured-images-overview', //Featured Images Plugin
'edit.php?post_type=tradeshows', //Tradeshows Directory
'edit.php?post_type=institutions', //Institutions Directory
'edit.php?post_type=agencies', //Agencies Directory
'edit.php?post_type=professionals', // Professionals Directory
'gf_edit_forms', // Gravity Forms Plugin
'edit.php?post_type=page', // Pages
'edit-comments.php', // Comments
'edit.php?post_type=bp-email', //BuddyPress Emails Plugin
'edit.php?post_type=avada_portfolio', //Portfolio Avada
'edit.php?post_type=avada_faq', //FAQ Avada
'separator2', // Second separator
'themes.php', // Appearance
'buddyboss-updater', //BuddyBoss Updater
'plugins.php', // Plugins
'users.php', // Users
'tools.php', // Tools
'options-general.php', // Settings
'edit.php?post_type=acf-field-group', //Advanced Custom Fields Plugin
'separator3', // Third separator
'wpseo_dashboard', //Yoast SEO
'edit.php?post_type=themefusion_elastic', //Elastic Slider
'seed_csp4', //Coming Soon SeedProd
'bp-general-settings', //BuddyPress General
'layerslider', //LayerSlider
'bsa-pro-sub-menu', //Ads Pro
'cptui_manage_post_types', //CPT UI
'separator4', //Fourth separator
'edit.php?post_type=mp-reminder', //MemberPress
'real3d_flipbook_admin', //Flipbook Plugin
'revslider', //Revslider
'bp-activity', //Buddypress Activity
'bp-groups', //Buddypress Groups
'separator-last' // Last separator
);
}
add_filter( 'custom_menu_order', '__return_true' );
add_filter( 'menu_order', 'wpse_custom_menu_order', 10, 1 );
I want to rearrange the entire array, however as a test, I simply moved the Posts 'edit.php' to the bottom to make sure everything was working:
//Rearrange the admin section
function wpse_custom_menu_order( $menu_ord ) {
if (!$menu_ord) return true;
return array(
'index.php', // Dashboard
'activity_log_page', //Activity Log
'avada', //Avada
'fusion-builder-options', //Fusion Builder Options
'edit.php?post_type=slide', //Fusion Slider Post Type
'separator1', // First separator
//Posts moved from here...
'edit.php?post_type=eguide_article', //eGUIDE Articles CPT
'edit.php?post_type=webinars', //Webinars CPT
'edit.php?post_type=tribe_events', //Tribe Events
'edit.php?post_type=vendors', //Products & Services Directory
'upload.php', // Media
'edit.php?post_type=associations', //Associations & Organizations Directory
'quick-featured-images-overview', //Featured Images Plugin
'edit.php?post_type=tradeshows', //Tradeshows Directory
'edit.php?post_type=institutions', //Institutions Directory
'edit.php?post_type=agencies', //Agencies Directory
'edit.php?post_type=professionals', // Professionals Directory
'gf_edit_forms', // Gravity Forms Plugin
'edit.php?post_type=page', // Pages
'edit-comments.php', // Comments
'edit.php?post_type=bp-email', //BuddyPress Emails Plugin
'edit.php?post_type=avada_portfolio', //Portfolio Avada
'edit.php?post_type=avada_faq', //FAQ Avada
'separator2', // Second separator
'themes.php', // Appearance
'buddyboss-updater', //BuddyBoss Updater
'plugins.php', // Plugins
'users.php', // Users
'tools.php', // Tools
'options-general.php', // Settings
'edit.php?post_type=acf-field-group', //Advanced Custom Fields Plugin
'separator3', // Third separator
'wpseo_dashboard', //Yoast SEO
'edit.php?post_type=themefusion_elastic', //Elastic Slider
'seed_csp4', //Coming Soon SeedProd
'bp-general-settings', //BuddyPress General
'layerslider', //LayerSlider
'bsa-pro-sub-menu', //Ads Pro
'cptui_manage_post_types', //CPT UI
'separator4', //Fourth separator
'edit.php?post_type=mp-reminder', //MemberPress
'real3d_flipbook_admin', //Flipbook Plugin
'revslider', //Revslider
'bp-activity', //Buddypress Activity
'bp-groups', //Buddypress Groups
'separator-last', // Last separator
'edit.php' // Posts MOVED HERE
);
}
add_filter( 'custom_menu_order', 'wpse_custom_menu_order', 10, 1 );
add_filter( 'menu_order', 'wpse_custom_menu_order', 10, 1 );
Reloaded the admin...nothing has moved. No errors, no issues - just nothing happens. I even tried changing the custom_menu_order filter to the one provided in the Wordpress Code Reference:
add_filter( 'custom_menu_order', '__return_true' );
But no change. What am I doing wrong?
P.S: I know there is a plugin that does this, but I have more than enough plugins running already, and would rather hard-code this if possible!