Display unselected terms as All
This commit is contained in:
@@ -63,19 +63,19 @@ class SP_Admin_CPT_Calendar extends SP_Admin_CPT {
|
||||
public function custom_columns( $column, $post_id ) {
|
||||
switch ( $column ):
|
||||
case 'sp_league':
|
||||
echo get_the_terms ( $post_id, 'sp_league' ) ? the_terms( $post_id, 'sp_league' ) : '—';
|
||||
echo get_the_terms ( $post_id, 'sp_league' ) ? the_terms( $post_id, 'sp_league' ) : __( 'All', 'sportspress' );
|
||||
break;
|
||||
case 'sp_season':
|
||||
echo get_the_terms ( $post_id, 'sp_season' ) ? the_terms( $post_id, 'sp_season' ) : '—';
|
||||
echo get_the_terms ( $post_id, 'sp_season' ) ? the_terms( $post_id, 'sp_season' ) : __( 'All', 'sportspress' );
|
||||
break;
|
||||
case 'sp_venue':
|
||||
echo get_the_terms ( $post_id, 'sp_venue' ) ? the_terms( $post_id, 'sp_venue' ) : '—';
|
||||
echo get_the_terms ( $post_id, 'sp_venue' ) ? the_terms( $post_id, 'sp_venue' ) : __( 'All', 'sportspress' );
|
||||
break;
|
||||
case 'sp_team':
|
||||
$teams = (array)get_post_meta( $post_id, 'sp_team', false );
|
||||
$teams = array_filter( $teams );
|
||||
if ( empty( $teams ) ):
|
||||
echo '—';
|
||||
echo __( 'All', 'sportspress' );
|
||||
else:
|
||||
$current_team = get_post_meta( $post_id, 'sp_current_team', true );
|
||||
foreach( $teams as $team_id ):
|
||||
|
||||
@@ -66,16 +66,16 @@ class SP_Admin_CPT_List extends SP_Admin_CPT {
|
||||
echo sizeof( $players );
|
||||
break;
|
||||
case 'sp_league':
|
||||
echo get_the_terms ( $post_id, 'sp_league' ) ? the_terms( $post_id, 'sp_league' ) : '—';
|
||||
echo get_the_terms ( $post_id, 'sp_league' ) ? the_terms( $post_id, 'sp_league' ) : __( 'All', 'sportspress' );
|
||||
break;
|
||||
case 'sp_season':
|
||||
echo get_the_terms ( $post_id, 'sp_season' ) ? the_terms( $post_id, 'sp_season' ) : '—';
|
||||
echo get_the_terms ( $post_id, 'sp_season' ) ? the_terms( $post_id, 'sp_season' ) : __( 'All', 'sportspress' );
|
||||
break;
|
||||
case 'sp_team':
|
||||
$teams = (array)get_post_meta( $post_id, 'sp_team', false );
|
||||
$teams = array_filter( $teams );
|
||||
if ( empty( $teams ) ):
|
||||
echo '—';
|
||||
echo __( 'All', 'sportspress' );
|
||||
else:
|
||||
foreach( $teams as $team_id ):
|
||||
if ( ! $team_id ) continue;
|
||||
|
||||
Reference in New Issue
Block a user