Created
July 18, 2013 00:45
-
-
Save dinolatoga/6025856 to your computer and use it in GitHub Desktop.
Add a Separator to the Admin Menu via http://wordpress.stackexchange.com/questions/2666/add-a-separator-to-the-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
function add_admin_menu_separator($position) { | |
global $menu; | |
$index = 0; | |
foreach($menu as $offset => $section) { | |
if (substr($section[2],0,9)=='separator') | |
$index++; | |
if ($offset>=$position) { | |
$menu[$position] = array('','read',"separator{$index}",'','wp-menu-separator'); | |
break; | |
} | |
} | |
ksort( $menu ); | |
} | |
// example implementation | |
add_action('admin_init','admin_menu_separator'); | |
function admin_menu_separator() { | |
add_admin_menu_separator(26); | |
add_admin_menu_separator(29); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment