Addition of managing officials
Added incorrectly missing includes/admin/post-types/meta-boxes/class-sp-meta-box-event-officials.php
This commit is contained in:
@@ -26,6 +26,7 @@ class SP_Admin_Menus {
|
||||
add_action( 'admin_menu', array( $this, 'config_menu' ), 7 );
|
||||
add_action( 'admin_menu', array( $this, 'leagues_menu' ), 20 );
|
||||
add_action( 'admin_menu', array( $this, 'seasons_menu' ), 21 );
|
||||
add_action( 'admin_menu', array( $this, 'officials_menu' ), 22 );
|
||||
|
||||
add_action( 'admin_head', array( $this, 'menu_highlight' ) );
|
||||
add_action( 'admin_head', array( $this, 'menu_rename' ) );
|
||||
@@ -68,6 +69,13 @@ class SP_Admin_Menus {
|
||||
add_submenu_page( 'sportspress', __( 'Seasons', 'sportspress' ), __( 'Seasons', 'sportspress' ), 'manage_sportspress', 'edit-tags.php?taxonomy=sp_season');
|
||||
}
|
||||
|
||||
/**
|
||||
* Add menu item
|
||||
*/
|
||||
public function officials_menu() {
|
||||
add_submenu_page( 'sportspress', __( 'Officials', 'sportspress' ), __( 'Officials', 'sportspress' ), 'manage_sportspress', 'edit-tags.php?taxonomy=sp_officials');
|
||||
}
|
||||
|
||||
/**
|
||||
* Highlights the correct top level admin menu item for post type add screens.
|
||||
*
|
||||
@@ -130,6 +138,7 @@ class SP_Admin_Menus {
|
||||
$sportspress_team = array_search( 'edit.php?post_type=sp_team', $menu_order );
|
||||
$sportspress_player = array_search( 'edit.php?post_type=sp_player', $menu_order );
|
||||
$sportspress_staff = array_search( 'edit.php?post_type=sp_staff', $menu_order );
|
||||
$sportspress_official = array_search( 'edit.php?post_type=sp_official', $menu_order );
|
||||
|
||||
// Loop through menu order and do some rearranging
|
||||
foreach ( $menu_order as $index => $item ):
|
||||
@@ -141,11 +150,13 @@ class SP_Admin_Menus {
|
||||
$sportspress_menu_order[] = 'edit.php?post_type=sp_team';
|
||||
$sportspress_menu_order[] = 'edit.php?post_type=sp_player';
|
||||
$sportspress_menu_order[] = 'edit.php?post_type=sp_staff';
|
||||
$sportspress_menu_order[] = 'edit.php?post_type=sp_official';
|
||||
unset( $menu_order[ $sportspress_separator ] );
|
||||
unset( $menu_order[ $sportspress_event ] );
|
||||
unset( $menu_order[ $sportspress_team ] );
|
||||
unset( $menu_order[ $sportspress_player ] );
|
||||
unset( $menu_order[ $sportspress_staff ] );
|
||||
unset( $menu_order[ $sportspress_official ] );
|
||||
|
||||
// Apply to added menu items
|
||||
$menu_items = apply_filters( 'sportspress_menu_items', array() );
|
||||
@@ -217,6 +228,11 @@ class SP_Admin_Menus {
|
||||
$submenu['edit.php?post_type=sp_staff'] = array_filter( $submenu['edit.php?post_type=sp_staff'], array( $this, 'remove_seasons' ) );
|
||||
endif;
|
||||
|
||||
if ( isset( $submenu['edit.php?post_type=sp_official'] ) ):
|
||||
$submenu['edit.php?post_type=sp_official'] = array_filter( $submenu['edit.php?post_type=sp_official'], array( $this, 'remove_leagues' ) );
|
||||
$submenu['edit.php?post_type=sp_official'] = array_filter( $submenu['edit.php?post_type=sp_official'], array( $this, 'remove_seasons' ) );
|
||||
endif;
|
||||
|
||||
$user_roles = $current_user->roles;
|
||||
$user_role = array_shift($user_roles);
|
||||
|
||||
@@ -281,4 +297,4 @@ class SP_Admin_Menus {
|
||||
|
||||
endif;
|
||||
|
||||
return new SP_Admin_Menus();
|
||||
return new SP_Admin_Menus();
|
||||
|
||||
Reference in New Issue
Block a user