'sp_officials',
- 'name' => 'tax_input[sp_officials][]',
- 'selected' => $official_ids,
- 'values' => 'term_id',
- 'placeholder' => sprintf( __( 'Select %s', 'sportspress' ), __( 'Officials', 'sportspress' ) ),
- 'class' => 'widefat',
- 'property' => 'multiple',
- 'chosen' => true,
- );
- sp_dropdown_taxonomies( $args );
- ?>
-
- 'sp_duty',
+ 'hide_empty' => false,
+ ) );
+
+ $officials = (array) get_post_meta( $post->ID, 'sp_officials', true );
+
+ foreach ( $duties as $duty ) {
+ ?>
+ 'sp_official',
+ 'name' => 'sp_officials[' . $duty->term_id . '][]',
+ 'selected' => sp_array_value( $officials, $duty->term_id, array() ),
+ 'values' => 'ID',
+ 'placeholder' => sprintf( __( 'Select %s', 'sportspress' ), __( 'Officials', 'sportspress' ) ),
+ 'class' => 'widefat',
+ 'property' => 'multiple',
+ 'chosen' => true,
+ );
+ sp_dropdown_pages( $args );
+ ?>
+ countries->continents;
+
+ $nationalities = get_post_meta( $post->ID, 'sp_nationality', false );
+ foreach ( $nationalities as $index => $nationality ):
+ if ( 2 == strlen( $nationality ) ):
+ $legacy = SP()->countries->legacy;
+ $nationality = strtolower( $nationality );
+ $nationality = sp_array_value( $legacy, $nationality, null );
+ $nationalities[ $index ] = $nationality;
+ endif;
+ endforeach;
+
+ if ( taxonomy_exists( 'sp_duty' ) ):
+ $positions = get_the_terms( $post->ID, 'sp_duty' );
+ $position_ids = array();
+ if ( $positions ):
+ foreach ( $positions as $position ):
+ $position_ids[] = $position->term_id;
+ endforeach;
+ endif;
+ endif;
+
+ $teams = get_posts( array( 'post_type' => 'sp_team', 'posts_per_page' => -1 ) );
+ $past_teams = array_filter( get_post_meta( $post->ID, 'sp_past_team', false ) );
+ $current_teams = array_filter( get_post_meta( $post->ID, 'sp_current_team', false ) );
+ ?>
+
+ 'sp_duty',
+ 'name' => 'tax_input[sp_duty][]',
+ 'selected' => $position_ids,
+ 'values' => 'term_id',
+ 'placeholder' => sprintf( __( 'Select %s', 'sportspress' ), __( 'Duties', 'sportspress' ) ),
+ 'class' => 'widefat',
+ 'property' => 'multiple',
+ 'chosen' => true,
+ );
+ sp_dropdown_taxonomies( $args );
+ ?>
+
+
+ 'sp_team',
+ 'name' => 'sp_current_team[]',
+ 'selected' => $current_teams,
+ 'values' => 'ID',
+ 'placeholder' => sprintf( __( 'Select %s', 'sportspress' ), __( 'Teams', 'sportspress' ) ),
+ 'class' => 'sp-current-teams widefat',
+ 'property' => 'multiple',
+ 'chosen' => true,
+ );
+ sp_dropdown_pages( $args );
+ ?>
+
+ 'sp_team',
+ 'name' => 'sp_past_team[]',
+ 'selected' => $past_teams,
+ 'values' => 'ID',
+ 'placeholder' => sprintf( __( 'Select %s', 'sportspress' ), __( 'Teams', 'sportspress' ) ),
+ 'class' => 'sp-past-teams widefat',
+ 'property' => 'multiple',
+ 'chosen' => true,
+ );
+ sp_dropdown_pages( $args );
+ ?>
+
|
- >
+ >
|