Skip to content

Instantly share code, notes, and snippets.

@teomaragakis
Last active December 26, 2015 05:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save teomaragakis/7100455 to your computer and use it in GitHub Desktop.
Save teomaragakis/7100455 to your computer and use it in GitHub Desktop.
A function that adds a separator to the WordPress Dashboard menu. Call add_menu_separator($position) with a number parameter.
<?php
/**
* add_menu_separator function.
*
* A function that lets you add a menu separator on a given menu position.
*
* @access public
* @param mixed $position
* @return void
* @author Teo Maragakis
*/
function add_menu_separator($position) {
global $menu;
$separator = array(
0 => '',
1 => 'read',
2 => 'separator' . $position,
3 => '',
4 => 'wp-menu-separator'
);
$menu[$position] = $separator;
ksort($menu);
} ?>
// Example
add_menu_separator('29');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment