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 ) {
|
public function custom_columns( $column, $post_id ) {
|
||||||
switch ( $column ):
|
switch ( $column ):
|
||||||
case 'sp_league':
|
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;
|
break;
|
||||||
case 'sp_season':
|
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;
|
break;
|
||||||
case 'sp_venue':
|
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;
|
break;
|
||||||
case 'sp_team':
|
case 'sp_team':
|
||||||
$teams = (array)get_post_meta( $post_id, 'sp_team', false );
|
$teams = (array)get_post_meta( $post_id, 'sp_team', false );
|
||||||
$teams = array_filter( $teams );
|
$teams = array_filter( $teams );
|
||||||
if ( empty( $teams ) ):
|
if ( empty( $teams ) ):
|
||||||
echo '—';
|
echo __( 'All', 'sportspress' );
|
||||||
else:
|
else:
|
||||||
$current_team = get_post_meta( $post_id, 'sp_current_team', true );
|
$current_team = get_post_meta( $post_id, 'sp_current_team', true );
|
||||||
foreach( $teams as $team_id ):
|
foreach( $teams as $team_id ):
|
||||||
|
|||||||
@@ -66,16 +66,16 @@ class SP_Admin_CPT_List extends SP_Admin_CPT {
|
|||||||
echo sizeof( $players );
|
echo sizeof( $players );
|
||||||
break;
|
break;
|
||||||
case 'sp_league':
|
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;
|
break;
|
||||||
case 'sp_season':
|
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;
|
break;
|
||||||
case 'sp_team':
|
case 'sp_team':
|
||||||
$teams = (array)get_post_meta( $post_id, 'sp_team', false );
|
$teams = (array)get_post_meta( $post_id, 'sp_team', false );
|
||||||
$teams = array_filter( $teams );
|
$teams = array_filter( $teams );
|
||||||
if ( empty( $teams ) ):
|
if ( empty( $teams ) ):
|
||||||
echo '—';
|
echo __( 'All', 'sportspress' );
|
||||||
else:
|
else:
|
||||||
foreach( $teams as $team_id ):
|
foreach( $teams as $team_id ):
|
||||||
if ( ! $team_id ) continue;
|
if ( ! $team_id ) continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user