From 3f3208a8c07e35ec9c022fec5b9e797dac8b4c95 Mon Sep 17 00:00:00 2001 From: savvasha Date: Sat, 29 Aug 2020 09:32:26 +0300 Subject: [PATCH 1/5] Update changelog for 2.7.3 Add 2.7.3 changelog --- changelog.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/changelog.txt b/changelog.txt index 157d91cd..2571f3ca 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,18 @@ == SportsPress Changelog == += 2.7.3 = +* Compatibility – Tested for compatibility with WordPress 5.5 with changes made where necessary. +* Tweak – Avoid showing minutes box for subs when not needed. +* Tweak – Improve filtering speed for queries without leagues or seasons. +* Tweak – Apply reverse order setting in event lists. +* Tweak – Enable filtering a player’s events played on a specific team. +* Fix – Include future events in REST API for WordPress 5.5. +* Fix – Enable updating player metrics using the REST API. +* Fix – Deprecated code for PHP 7.4. +* Fix – Elementor compatibility. +* Localization – Update country names for Czechia, North Macedonia, Myanmar, and Eswatini. +* Localization – Adjust RTL stylesheet for event performance icons. + = 2.7.2 = * Tweak - Sanitize delimiter field in event settings. From 2fb60bfa430fe02917313555a45aedcfb576dad6 Mon Sep 17 00:00:00 2001 From: savvasha Date: Sat, 29 Aug 2020 14:50:04 +0300 Subject: [PATCH 2/5] Tag version 2.7.3 --- changelog.txt | 22 +++++++++---------- .../class-sp-meta-box-event-performance.php | 2 +- includes/api/class-sp-rest-api.php | 2 +- includes/class-sp-player-list.php | 2 +- includes/class-sp-player.php | 2 +- includes/sp-formatting-functions.php | 2 +- modules/sportspress-player-assignments.php | 6 ++--- readme.txt | 17 ++++++++++++-- sportspress.php | 8 +++---- templates/event-blocks.php | 2 +- templates/event-list.php | 2 +- 11 files changed, 40 insertions(+), 27 deletions(-) diff --git a/changelog.txt b/changelog.txt index 2571f3ca..272dd44e 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,17 +1,17 @@ == SportsPress Changelog == = 2.7.3 = -* Compatibility – Tested for compatibility with WordPress 5.5 with changes made where necessary. -* Tweak – Avoid showing minutes box for subs when not needed. -* Tweak – Improve filtering speed for queries without leagues or seasons. -* Tweak – Apply reverse order setting in event lists. -* Tweak – Enable filtering a player’s events played on a specific team. -* Fix – Include future events in REST API for WordPress 5.5. -* Fix – Enable updating player metrics using the REST API. -* Fix – Deprecated code for PHP 7.4. -* Fix – Elementor compatibility. -* Localization – Update country names for Czechia, North Macedonia, Myanmar, and Eswatini. -* Localization – Adjust RTL stylesheet for event performance icons. +* Compatibility - Tested for compatibility with WordPress 5.5 with changes made where necessary. +* Tweak - Avoid showing minutes box for subs when not needed. +* Tweak - Improve filtering speed for queries without leagues or seasons. +* Tweak - Apply reverse order setting in event lists. +* Tweak - Enable filtering a player's events played on a specific team. +* Fix - Include future events in REST API for WordPress 5.5. +* Fix - Enable updating player metrics using the REST API. +* Fix - Deprecated code for PHP 7.4. +* Fix - Elementor compatibility. +* Localization - Update country names for Czechia, North Macedonia, Myanmar, and Eswatini. +* Localization - Adjust RTL stylesheet for event performance icons. = 2.7.2 = * Tweak - Sanitize delimiter field in event settings. diff --git a/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php b/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php index 2bf07a98..ed389b94 100644 --- a/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php +++ b/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php @@ -5,7 +5,7 @@ * @author ThemeBoy * @category Admin * @package SportsPress/Admin/Meta_Boxes - * @version 2.6.19 + * @version 2.7.3 */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly diff --git a/includes/api/class-sp-rest-api.php b/includes/api/class-sp-rest-api.php index 1eb8a0a0..859b5a3c 100644 --- a/includes/api/class-sp-rest-api.php +++ b/includes/api/class-sp-rest-api.php @@ -5,7 +5,7 @@ * The SportsPress REST API class handles all API-related hooks. * * @class SP_REST_API - * @version 2.6.1 + * @version 2.7.3 * @package SportsPress/Classes * @category Class * @package SportsPress/API diff --git a/includes/class-sp-player-list.php b/includes/class-sp-player-list.php index 21829300..67f308d7 100644 --- a/includes/class-sp-player-list.php +++ b/includes/class-sp-player-list.php @@ -5,7 +5,7 @@ * The SportsPress player list class handles individual player list data. * * @class SP_Player_List - * @version 2.7.1 + * @version 2.7.3 * @package SportsPress/Classes * @category Class * @author ThemeBoy diff --git a/includes/class-sp-player.php b/includes/class-sp-player.php index c16d5888..bba3face 100644 --- a/includes/class-sp-player.php +++ b/includes/class-sp-player.php @@ -5,7 +5,7 @@ * The SportsPress player class handles individual player data. * * @class SP_Player - * @version 2.7 + * @version 2.7.3 * @package SportsPress/Classes * @category Class * @author ThemeBoy diff --git a/includes/sp-formatting-functions.php b/includes/sp-formatting-functions.php index 463f71e0..accc4a2a 100644 --- a/includes/sp-formatting-functions.php +++ b/includes/sp-formatting-functions.php @@ -7,7 +7,7 @@ * @author ThemeBoy * @category Core * @package SportsPress/Functions - * @version 2.4 + * @version 2.7.3 */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly diff --git a/modules/sportspress-player-assignments.php b/modules/sportspress-player-assignments.php index c25f2b52..d802092a 100644 --- a/modules/sportspress-player-assignments.php +++ b/modules/sportspress-player-assignments.php @@ -5,7 +5,7 @@ Plugin URI: http://themeboy.com/ Description: Add player assignments support to SportsPress. Author: Savvas Author URI: http://themeboy.com/ -Version: 2.6.10 +Version: 2.7.3 */ // Exit if accessed directly if ( ! defined( 'ABSPATH' ) ) exit; @@ -14,7 +14,7 @@ if ( ! class_exists( 'SportsPress_Player_Assignments' ) ) : * Main SportsPress Player Assignments Class * * @class SportsPress_Player_Assignments - * @version 2.6.10 + * @version 2.7.3 */ class SportsPress_Player_Assignments { /** @@ -36,7 +36,7 @@ class SportsPress_Player_Assignments { */ private function define_constants() { if ( !defined( 'SP_PLAYER_ASSIGNMENTS_VERSION' ) ) - define( 'SP_PLAYER_ASSIGNMENTS_VERSION', '2.6.10' ); + define( 'SP_PLAYER_ASSIGNMENTS_VERSION', '2.7.3' ); if ( !defined( 'SP_PLAYER_ASSIGNMENTS_URL' ) ) define( 'SP_PLAYER_ASSIGNMENTS_URL', plugin_dir_url( __FILE__ ) ); if ( !defined( 'SP_PLAYER_ASSIGNMENTS_DIR' ) ) diff --git a/readme.txt b/readme.txt index 7de44e03..b9f7daca 100644 --- a/readme.txt +++ b/readme.txt @@ -3,8 +3,8 @@ 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 -Stable tag: 2.7.2 +Tested up to: 5.5 +Stable tag: 2.7.3 License: GPLv3 License URI: http://www.gnu.org/licenses/gpl-3.0.html @@ -240,6 +240,19 @@ When you upgrade to one of the SportsPress Pro licenses, you can simply activate == Changelog == += 2.7.3 = +* Compatibility - Tested for compatibility with WordPress 5.5 with changes made where necessary. +* Tweak - Avoid showing minutes box for subs when not needed. +* Tweak - Improve filtering speed for queries without leagues or seasons. +* Tweak - Apply reverse order setting in event lists. +* Tweak - Enable filtering a player's events played on a specific team. +* Fix - Include future events in REST API for WordPress 5.5. +* Fix - Enable updating player metrics using the REST API. +* Fix - Deprecated code for PHP 7.4. +* Fix - Elementor compatibility. +* Localization - Update country names for Czechia, North Macedonia, Myanmar, and Eswatini. +* Localization - Adjust RTL stylesheet for event performance icons. + = 2.7.2 = * Tweak - Sanitize delimiter field in event settings. diff --git a/sportspress.php b/sportspress.php index 1c412849..73db95fb 100644 --- a/sportspress.php +++ b/sportspress.php @@ -3,11 +3,11 @@ * Plugin Name: SportsPress * Plugin URI: http://themeboy.com/sportspress/ * Description: Manage your club and its players, staff, events, league tables, and player lists. - * Version: 2.7.2 + * Version: 2.7.3 * 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/ @@ -26,14 +26,14 @@ if ( ! class_exists( 'SportsPress' ) ) : * Main SportsPress Class * * @class SportsPress - * @version 2.7.2 + * @version 2.7.3 */ final class SportsPress { /** * @var string */ - public $version = '2.7.2'; + public $version = '2.7.3'; /** * @var SportsPress The single instance of the class diff --git a/templates/event-blocks.php b/templates/event-blocks.php index c17e88b8..639c360f 100644 --- a/templates/event-blocks.php +++ b/templates/event-blocks.php @@ -4,7 +4,7 @@ * * @author ThemeBoy * @package SportsPress/Templates - * @version 2.6.15 + * @version 2.7.3 */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly diff --git a/templates/event-list.php b/templates/event-list.php index c50c5a14..8741a010 100644 --- a/templates/event-list.php +++ b/templates/event-list.php @@ -4,7 +4,7 @@ * * @author ThemeBoy * @package SportsPress/Templates - * @version 2.7.1 + * @version 2.7.3 */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly From 7969ae66031b93e1ace36246e88b141f234fe1d1 Mon Sep 17 00:00:00 2001 From: savvasha Date: Sat, 29 Aug 2020 14:54:09 +0300 Subject: [PATCH 3/5] Tag version 2.7.3 (2) --- includes/class-sp-countries.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-sp-countries.php b/includes/class-sp-countries.php index 79c0d346..c6fee338 100644 --- a/includes/class-sp-countries.php +++ b/includes/class-sp-countries.php @@ -5,7 +5,7 @@ * The SportsPress countries class stores continent/country data. * * @class SP_Countries - * @version 2.6.8 + * @version 2.7.3 * @package SportsPress/Classes * @category Class * @author ThemeBoy From dfea672c4429c36140f263b943051878402f6839 Mon Sep 17 00:00:00 2001 From: savvasha Date: Sun, 30 Aug 2020 10:43:04 +0300 Subject: [PATCH 4/5] Return all events that a team participated. --- includes/class-sp-player-list.php | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) 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; From e50265a5cd1dcc9888c33f1abd883ecc63ab0008 Mon Sep 17 00:00:00 2001 From: savvasha Date: Sun, 30 Aug 2020 11:06:45 +0300 Subject: [PATCH 5/5] 1) Fix warning for unknown variable $groups 2) Show DoB or Age based on Settings --- templates/birthdays.php | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) 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";