Tidy up player edit screen and add custom menu icons
This commit is contained in:
@@ -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' );
|
||||
|
||||
Reference in New Issue
Block a user