Skip to content

Instantly share code, notes, and snippets.

@mindctrl
Created January 9, 2025 18:00
Show Gist options
  • Save mindctrl/2c8a08c619f9adbcbff9e8390a69d06d to your computer and use it in GitHub Desktop.
Save mindctrl/2c8a08c619f9adbcbff9e8390a69d06d to your computer and use it in GitHub Desktop.
Move Jetpack menu to bottom of wp-admin
<?php
add_action( 'admin_menu', function() {
global $menu;
// Find the Jetpack menu
$jetpack_menu = false;
foreach ( $menu as $key => $menu_item ) {
if ( $menu_item[2] === 'jetpack' ) {
$jetpack_menu = $menu[$key];
unset( $menu[$key] ); // Remove it from the current position
$menu[102] = $jetpack_menu; // Add Jetpack menu to a lower position
break;
}
}
if ( ! $jetpack_menu ) {
return;
}
ksort( $menu ); // Sort the menu to maintain proper order
}, 999 );
@mindctrl
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment