Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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