Add season and venue dropdowns to event edit page

This commit is contained in:
Brian Miyaji
2014-01-11 17:05:29 +11:00
parent 81a43185b8
commit 36a8e038b3
4 changed files with 46 additions and 11 deletions

View File

@@ -24,16 +24,11 @@ function sportspress_admin_menu( $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 "Seasons" link under Events
unset( $submenu['edit.php?post_type=sp_event'][15] );
// Remove "Seasons" link under Players
// Remove "Seasons" link from Players submenu
unset( $submenu['edit.php?post_type=sp_player'][15] );
// Remove "Seasons" link under Staff
// Remove "Seasons" link from Staff submenu
unset( $submenu['edit.php?post_type=sp_staff'][15] );
}
add_action( 'admin_menu', 'sportspress_admin_menu' );

View File

@@ -32,6 +32,12 @@ function sportspress_save_post( $post_id ) {
// Update staff array
sportspress_update_post_meta_recursive( $post_id, 'sp_staff', sportspress_array_value( $_POST, 'sp_staff', array() ) );
// Update season taxonomy
wp_set_post_terms( $post_id, sportspress_array_value( $_POST, 'sp_season', 0 ), 'sp_season' );
// Update venue taxonomy
wp_set_post_terms( $post_id, sportspress_array_value( $_POST, 'sp_venue', 0 ), 'sp_venue' );
break;
case ( 'sp_column' ):