Created
July 18, 2013 00:51
-
-
Save dinolatoga/6025880 to your computer and use it in GitHub Desktop.
Add admin separator to admin menu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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