Skip to content

Instantly share code, notes, and snippets.

@dinolatoga
Created July 18, 2013 00:51
Show Gist options
  • Save dinolatoga/6025880 to your computer and use it in GitHub Desktop.
Save dinolatoga/6025880 to your computer and use it in GitHub Desktop.
Add admin separator to admin menu
add_action( 'admin_init', 'add_sep' );
function add_sep() {
if ( ! is_admin() )
return false;
global $menu;
$sep = $menu[4]; // that's the default separator
$pos = 6; // change it for the desired position
$menu = array_merge(
array_slice( $menu, 0, $pos ),
array( $sep ),
array_slice( $menu, $pos + 1, -1)
);
$menu[ $pos - 1 ][4] .= ' menu-top-last';
$menu[ $pos + 1 ][4] .= ' menu-top-first';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment