Add settings and presets

This commit is contained in:
ThemeBoy
2013-12-28 05:37:41 +11:00
parent 03f0ce2893
commit 51bf14e85d
35 changed files with 1882 additions and 184 deletions

View File

@@ -10,12 +10,26 @@ function sp_after_theme_setup() {
}
add_action( 'after_theme_setup', 'sp_after_theme_setup' );
function sp_admin_menu() {
function sp_admin_menu( $position ) {
if ( ! current_user_can( 'manage_options' ) )
return;
global $menu, $submenu;
// Find where our placeholder is in the menu
foreach( $menu as $key => $data ) {
if ( is_array( $data ) && array_key_exists( 2, $data ) && $data[2] == 'edit.php?post_type=sp_separator' )
$position = $key;
}
// Swap our placeholder post type with a menu separator
if ( $position ):
$menu[ $position ] = array( '', 'read', 'separator-sportspress', '', 'wp-menu-separator sportspress' );
endif;
// Remove "Add Configuration" link under SportsPress
unset( $submenu['edit.php?post_type=sp_config'][10] );
// Remove "Leagues" link under Events
unset( $submenu['edit.php?post_type=sp_event'][15] );