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( |
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; | |
} |
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
<?php | |
// Helper Functions | |
/** | |
* Programmatically creates a WordPress post based on the incoming parameters. | |
* | |
* Note: This function may need some additional work if you're dealing with non-English languages. | |
* | |
* @param string $title The title of the page as presented to the users | |
* @param string $slug The slug used to access the page via the URL |
NewerOlder