diff --git a/includes/class-sp-player-list.php b/includes/class-sp-player-list.php index 67f308d7..3f9a726c 100644 --- a/includes/class-sp-player-list.php +++ b/includes/class-sp-player-list.php @@ -377,18 +377,11 @@ class SP_Player_List extends SP_Secondary_Post { $team_key = 'sp_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( array( 'key' => $team_key, - 'value' => $team + 'value' => $team, + 'compare' => 'IN', ), ); endif; diff --git a/readme.txt b/readme.txt index 0cc37dc4..b9f7daca 100644 --- a/readme.txt +++ b/readme.txt @@ -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 Donate link: http://tboy.co/donate Requires at least: 3.8 -Tested up to: 5.3 +Tested up to: 5.5 Stable tag: 2.7.3 License: GPLv3 License URI: http://www.gnu.org/licenses/gpl-3.0.html diff --git a/sportspress.php b/sportspress.php index b1947365..73db95fb 100644 --- a/sportspress.php +++ b/sportspress.php @@ -7,7 +7,7 @@ * Author: ThemeBoy * Author URI: http://themeboy.com * Requires at least: 3.8 - * Tested up to: 5.3 + * Tested up to: 5.5 * * Text Domain: sportspress * Domain Path: /languages/ diff --git a/templates/birthdays.php b/templates/birthdays.php index 7c52b5a9..a348df40 100644 --- a/templates/birthdays.php +++ b/templates/birthdays.php @@ -17,7 +17,9 @@ $defaults = array( 'captiontag' => 'dd', 'size' => 'sportspress-fit-medium', '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, + '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_staff' => get_option( 'sportspress_link_staff', 'yes' ) == 'yes' ? true : false, ); @@ -84,31 +86,40 @@ foreach ( $posts as $post ) { if ( 'sp_staff' == $post->post_type ) { $link_posts = $link_staff; $show_birthday = $show_staff_birthday; + $show_age = $sportspress_staff_show_age; } else { $link_posts = $link_players; $show_birthday = $show_player_birthday; + $show_age = $show_player_age; } $birthday = get_the_date( get_option( 'date_format') , $post->ID ); - if ( $show_birthday && $birthday && $group !== $birthday ) { - echo '

' . $birthday . '

'; + $heading = null; + if ( $show_birthday && $birthday ) { + $heading = '

' . $birthday . '

'; } - + 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 = '

' . $age . __( ' years old', 'sportspress' ) . '

'; + } + echo $heading; + echo '\n";