This commit is contained in:
Brian Miyaji
2020-08-30 21:45:47 +10:00
4 changed files with 27 additions and 23 deletions

View File

@@ -377,18 +377,11 @@ class SP_Player_List extends SP_Secondary_Post {
$team_key = 'sp_team'; $team_key = 'sp_team';
if ( $team ): if ( $team ):
switch ( $era ):
case 'current':
$team_key = 'sp_current_team';
break;
case 'past':
$team_key = 'sp_past_team';
break;
endswitch;
$args['meta_query'][] = array( $args['meta_query'][] = array(
array( array(
'key' => $team_key, 'key' => $team_key,
'value' => $team 'value' => $team,
'compare' => 'IN',
), ),
); );
endif; endif;

View File

@@ -3,7 +3,7 @@ Contributors: ThemeBoy, brianmiyaji, aylaview, savvasha, nabil_kadimi, rochester
Tags: calendars, club, club management, esports, events, fixtures, leagues, league management, sports, sports club, sports data, team rosters Tags: calendars, club, club management, esports, events, fixtures, leagues, league management, sports, sports club, sports data, team rosters
Donate link: http://tboy.co/donate Donate link: http://tboy.co/donate
Requires at least: 3.8 Requires at least: 3.8
Tested up to: 5.3 Tested up to: 5.5
Stable tag: 2.7.3 Stable tag: 2.7.3
License: GPLv3 License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html License URI: http://www.gnu.org/licenses/gpl-3.0.html

View File

@@ -7,7 +7,7 @@
* Author: ThemeBoy * Author: ThemeBoy
* Author URI: http://themeboy.com * Author URI: http://themeboy.com
* Requires at least: 3.8 * Requires at least: 3.8
* Tested up to: 5.3 * Tested up to: 5.5
* *
* Text Domain: sportspress * Text Domain: sportspress
* Domain Path: /languages/ * Domain Path: /languages/

View File

@@ -17,7 +17,9 @@ $defaults = array(
'captiontag' => 'dd', 'captiontag' => 'dd',
'size' => 'sportspress-fit-medium', 'size' => 'sportspress-fit-medium',
'show_player_birthday' => get_option( 'sportspress_player_show_birthday', 'no' ) == 'yes' ? true : false, 'show_player_birthday' => get_option( 'sportspress_player_show_birthday', 'no' ) == 'yes' ? true : false,
'show_player_age' => get_option( 'sportspress_player_show_age', 'no' ) == 'yes' ? true : false,
'show_staff_birthday' => get_option( 'sportspress_staff_show_birthday', 'no' ) == 'yes' ? true : false, 'show_staff_birthday' => get_option( 'sportspress_staff_show_birthday', 'no' ) == 'yes' ? true : false,
'sportspress_staff_show_age' => get_option( 'sportspress_staff_show_age', 'no' ) == 'yes' ? true : false,
'link_players' => get_option( 'sportspress_link_players', 'yes' ) == 'yes' ? true : false, 'link_players' => get_option( 'sportspress_link_players', 'yes' ) == 'yes' ? true : false,
'link_staff' => get_option( 'sportspress_link_staff', 'yes' ) == 'yes' ? true : false, 'link_staff' => get_option( 'sportspress_link_staff', 'yes' ) == 'yes' ? true : false,
); );
@@ -84,16 +86,25 @@ foreach ( $posts as $post ) {
if ( 'sp_staff' == $post->post_type ) { if ( 'sp_staff' == $post->post_type ) {
$link_posts = $link_staff; $link_posts = $link_staff;
$show_birthday = $show_staff_birthday; $show_birthday = $show_staff_birthday;
$show_age = $sportspress_staff_show_age;
} else { } else {
$link_posts = $link_players; $link_posts = $link_players;
$show_birthday = $show_player_birthday; $show_birthday = $show_player_birthday;
$show_age = $show_player_age;
} }
$birthday = get_the_date( get_option( 'date_format') , $post->ID ); $birthday = get_the_date( get_option( 'date_format') , $post->ID );
if ( $show_birthday && $birthday && $group !== $birthday ) { $heading = null;
echo '<h4 class="sp-table-caption">' . $birthday . '</h4>'; if ( $show_birthday && $birthday ) {
$heading = '<h4 class="sp-table-caption">' . $birthday . '</h4>';
} }
if ( $show_birthday && $show_age && $birthday ) {
$sp_birthdays = new SportsPress_Birthdays();
$age = $sp_birthdays->get_age( get_the_date( 'm-d-Y', $post->ID ) );
$heading = '<h4 class="sp-table-caption">' . $age . __( ' years old', 'sportspress' ) . '</h4>';
}
echo $heading;
echo '<div class="gallery">'; echo '<div class="gallery">';