Skip to content

Instantly share code, notes, and snippets.

@mindctrl
Created January 13, 2025 21:16
Show Gist options
  • Save mindctrl/65651de0c5220b277e090b099af17372 to your computer and use it in GitHub Desktop.
Save mindctrl/65651de0c5220b277e090b099af17372 to your computer and use it in GitHub Desktop.
Move Genesis Blocks wp-admin menu to the bottom
<?php
add_action( 'admin_menu', function() {
global $menu;
// Find the Genesis Blocks menu (genesis-blocks-getting-started)
$genesis_blocks_menu = false;
foreach ( $menu as $key => $menu_item ) {
if ( $menu_item[2] === 'genesis-blocks-getting-started' ) {
$genesis_blocks_menu = $menu[$key];
unset( $menu[$key] ); // Remove it from the current position
break;
}
}
if ( ! $genesis_blocks_menu ) {
return;
}
// Add menu to a lower position
$menu[102] = $genesis_blocks_menu;
ksort( $menu ); // Sort the menu to maintain proper order
}, 101 );
@mindctrl
Copy link
Author

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