Tidy up player edit screen and add custom menu icons

This commit is contained in:
Brian Miyaji
2014-02-18 19:33:06 +11:00
parent f07f60d593
commit 1b30d3a4ce
19 changed files with 293 additions and 209 deletions

View File

@@ -3,15 +3,15 @@ function sportspress_admin_menu( $position ) {
global $menu, $submenu;
// Find where our placeholder is in the menu
// Find where our separator 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' )
$seperator_position = $key;
$separator_position = $key;
endforeach;
// Swap our placeholder post type with a menu separator
if ( $seperator_position ):
$menu[ $seperator_position ] = array( '', 'read', 'separator-sportspress', '', 'wp-menu-separator sportspress' );
// Swap our separator post type with a menu separator
if ( isset( $separator_position ) ):
$menu[ $separator_position ] = array( '', 'read', 'separator-sportspress', '', 'wp-menu-separator sportspress' );
endif;
// Remove "Venues" and "Positions" links from Media submenu
@@ -41,6 +41,12 @@ function sportspress_admin_menu( $position ) {
}
add_action( 'admin_menu', 'sportspress_admin_menu' );
if ( ! function_exists( 'sportspress_admin_menu_remove_add_new' ) ) {
function sportspress_admin_menu_remove_add_new( $arr = array() ) {
return $arr[0] != __( 'Add New', 'sportspress' );
}
}
if ( ! function_exists( 'sportspress_admin_menu_remove_leagues' ) ) {
function sportspress_admin_menu_remove_leagues( $arr = array() ) {
return $arr[0] != __( 'Leagues', 'sportspress' );