SportsPress – Sports Club & League Manager - Version 2.7.3

Version Description

  • 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.
Download this release

Release Info

Developer ThemeBoy
Plugin Icon 128x128 SportsPress – Sports Club & League Manager
Version 2.7.3
Comparing to
See all releases

Code changes from version 2.7.2 to 2.7.3

assets/css/sportspress-rtl.css CHANGED
@@ -37,6 +37,21 @@
37
  margin-left: 0.5em;
38
  }
39
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  /* Event Calendar */
41
  .sp-event-calendar #next {
42
  text-align: left;
37
  margin-left: 0.5em;
38
  }
39
 
40
+ /* Event Performance (Icons) */
41
+ .sp-event-performance-teams .sp-template-event-performance-icons {
42
+ float: right;
43
+ clear: right;
44
+ padding-right: 0;
45
+ padding-left: 10px;
46
+ }
47
+
48
+ .sp-event-performance-teams .sp-template-event-performance-icons:nth-child(2n) {
49
+ float: left;
50
+ clear: left;
51
+ padding-left: 0;
52
+ padding-right: 10px;
53
+ }
54
+
55
  /* Event Calendar */
56
  .sp-event-calendar #next {
57
  text-align: left;
assets/js/admin/editor.js CHANGED
@@ -11,7 +11,7 @@
11
  var p = g.split("[");
12
  var label = p.shift();
13
  var variations = p.shift();
14
- var shortcodes = variations.split("|");
15
  var submenu = new Array();
16
  shortcodes.forEach(function(s) {
17
  submenu.push({
11
  var p = g.split("[");
12
  var label = p.shift();
13
  var variations = p.shift();
14
+ var shortcodes = typeof variations!== 'undefined' ? variations.split("|") : [];
15
  var submenu = new Array();
16
  shortcodes.forEach(function(s) {
17
  submenu.push({
changelog.txt CHANGED
@@ -1,5 +1,18 @@
1
  == SportsPress Changelog ==
2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  = 2.7.2 =
4
  * Tweak - Sanitize delimiter field in event settings.
5
 
1
  == SportsPress Changelog ==
2
 
3
+ = 2.7.3 =
4
+ * Compatibility - Tested for compatibility with WordPress 5.5 with changes made where necessary.
5
+ * Tweak - Avoid showing minutes box for subs when not needed.
6
+ * Tweak - Improve filtering speed for queries without leagues or seasons.
7
+ * Tweak - Apply reverse order setting in event lists.
8
+ * Tweak - Enable filtering a player's events played on a specific team.
9
+ * Fix - Include future events in REST API for WordPress 5.5.
10
+ * Fix - Enable updating player metrics using the REST API.
11
+ * Fix - Deprecated code for PHP 7.4.
12
+ * Fix - Elementor compatibility.
13
+ * Localization - Update country names for Czechia, North Macedonia, Myanmar, and Eswatini.
14
+ * Localization - Adjust RTL stylesheet for event performance icons.
15
+
16
  = 2.7.2 =
17
  * Tweak - Sanitize delimiter field in event settings.
18
 
includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
- * @version 2.6.19
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -503,8 +503,10 @@ class SP_Meta_Box_Event_Performance {
503
  ?>
504
  <?php echo self::status_select( $team_id, $player_id, sp_array_value( $player_performance, 'status', null ) ); ?><br>
505
  <?php echo self::sub_select( $team_id, $player_id, sp_array_value( $player_performance, 'sub', null ), $data ); ?><br>
506
- <input class="sp-sync-input small-text" type="text" name="sp_timeline[<?php echo $team_id; ?>][<?php echo $player_id; ?>][sub][]" value="<?php echo esc_attr( sp_array_value( $times, 0, '' ) ); ?>" placeholder="-" />
507
- <span class="description"><?php _e( 'mins', 'sportspress' ); ?></span>
 
 
508
  </td>
509
  <?php } ?>
510
  <?php if ( $stars_type ) { ?>
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
+ * @version 2.7.3
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
503
  ?>
504
  <?php echo self::status_select( $team_id, $player_id, sp_array_value( $player_performance, 'status', null ) ); ?><br>
505
  <?php echo self::sub_select( $team_id, $player_id, sp_array_value( $player_performance, 'sub', null ), $data ); ?><br>
506
+ <?php if ( is_array( $times ) ) { ?>
507
+ <input class="sp-sync-input small-text" type="text" name="sp_timeline[<?php echo $team_id; ?>][<?php echo $player_id; ?>][sub][]" value="<?php echo esc_attr( sp_array_value( $times, 0, '' ) ); ?>" placeholder="-" />
508
+ <span class="description"><?php _e( 'mins', 'sportspress' ); ?></span>
509
+ <?php } ?>
510
  </td>
511
  <?php } ?>
512
  <?php if ( $stars_type ) { ?>
includes/api/class-sp-rest-api.php CHANGED
@@ -5,7 +5,7 @@
5
  * The SportsPress REST API class handles all API-related hooks.
6
  *
7
  * @class SP_REST_API
8
- * @version 2.6.1
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @package SportsPress/API
@@ -430,7 +430,6 @@ class SP_REST_API {
430
  'update_callback' => 'SP_REST_API::update_post_meta_array',
431
  'schema' => array(
432
  'description' => __( 'Metrics', 'sportspress' ),
433
- 'type' => 'array',
434
  'context' => array( 'view', 'edit' ),
435
  'arg_options' => array(
436
  'sanitize_callback' => 'rest_sanitize_request_arg',
@@ -564,6 +563,11 @@ class SP_REST_API {
564
  * @return bool|int
565
  */
566
  public static function update_post_meta_array( $value, $object, $field_name ) {
 
 
 
 
 
567
  if ( ! is_array( $value ) ) return false;
568
 
569
  $type = $object->post_type;
5
  * The SportsPress REST API class handles all API-related hooks.
6
  *
7
  * @class SP_REST_API
8
+ * @version 2.7.3
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @package SportsPress/API
430
  'update_callback' => 'SP_REST_API::update_post_meta_array',
431
  'schema' => array(
432
  'description' => __( 'Metrics', 'sportspress' ),
 
433
  'context' => array( 'view', 'edit' ),
434
  'arg_options' => array(
435
  'sanitize_callback' => 'rest_sanitize_request_arg',
563
  * @return bool|int
564
  */
565
  public static function update_post_meta_array( $value, $object, $field_name ) {
566
+ // Convert PHP object to array
567
+ if ( is_object( $value ) ) {
568
+ $value = (array) $value;
569
+ }
570
+
571
  if ( ! is_array( $value ) ) return false;
572
 
573
  $type = $object->post_type;
includes/api/class-sp-rest-posts-controller.php CHANGED
@@ -6,5 +6,15 @@ if ( class_exists( 'WP_REST_Posts_Controller' ) ) {
6
  parent::__construct( $post_type );
7
  $this->namespace = 'sportspress/v2';
8
  }
9
- }
 
 
 
 
 
 
 
 
 
 
10
  }
6
  parent::__construct( $post_type );
7
  $this->namespace = 'sportspress/v2';
8
  }
9
+
10
+ public function check_read_permission( $post ) {
11
+ if ( 'sp_event' === $post->post_type ) {
12
+ if ( in_array( $post->post_status, array( 'publish', 'future' ) ) || current_user_can( 'read_post', $post->ID ) ) {
13
+ return true;
14
+ }
15
+ } else {
16
+ return WP_REST_Posts_Controller::check_read_permission( $post );
17
+ }
18
+ }
19
+ }
20
  }
includes/class-sp-countries.php CHANGED
@@ -5,7 +5,7 @@
5
  * The SportsPress countries class stores continent/country data.
6
  *
7
  * @class SP_Countries
8
- * @version 2.6.8
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
@@ -320,7 +320,7 @@ class SP_Countries {
320
  'cub' => __( "Cuba", 'sportspress' ),
321
  'cuw' => __( "Curacao", 'sportspress' ),
322
  'cyp' => __( "Cyprus", 'sportspress' ),
323
- 'cze' => __( "Czech Republic", 'sportspress' ),
324
  'den' => __( "Denmark", 'sportspress' ),
325
  'dji' => __( "Djibouti", 'sportspress' ),
326
  'dma' => __( "Dominica", 'sportspress' ),
@@ -395,7 +395,7 @@ class SP_Countries {
395
  'mdv' => __( "Maldives", 'sportspress' ),
396
  'mex' => __( "Mexico", 'sportspress' ),
397
  'mhl' => __( "Marshall Islands", 'sportspress' ),
398
- 'mkd' => __( "Macedonia", 'sportspress' ),
399
  'mli' => __( "Mali", 'sportspress' ),
400
  'mlt' => __( "Malta", 'sportspress' ),
401
  'mne' => __( "Montenegro", 'sportspress' ),
@@ -405,7 +405,7 @@ class SP_Countries {
405
  'msr' => __( "Montserrat", 'sportspress' ),
406
  'mtn' => __( "Mauritania", 'sportspress' ),
407
  'mwi' => __( "Malawi", 'sportspress' ),
408
- 'mya' => __( "Burma", 'sportspress' ),
409
  'nam' => __( "Namibia", 'sportspress' ),
410
  'nca' => __( "Nicaragua", 'sportspress' ),
411
  'ncl' => __( "New Caledonia", 'sportspress' ),
@@ -456,7 +456,7 @@ class SP_Countries {
456
  'svk' => __( "Slovakia", 'sportspress' ),
457
  'svn' => __( "Slovenia", 'sportspress' ),
458
  'swe' => __( "Sweden", 'sportspress' ),
459
- 'swz' => __( "Swaziland", 'sportspress' ),
460
  'syr' => __( "Syria", 'sportspress' ),
461
  'tah' => __( "Tahiti", 'sportspress' ),
462
  'tan' => __( "Tanzania", 'sportspress' ),
5
  * The SportsPress countries class stores continent/country data.
6
  *
7
  * @class SP_Countries
8
+ * @version 2.7.3
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
320
  'cub' => __( "Cuba", 'sportspress' ),
321
  'cuw' => __( "Curacao", 'sportspress' ),
322
  'cyp' => __( "Cyprus", 'sportspress' ),
323
+ 'cze' => __( "Czechia", 'sportspress' ),
324
  'den' => __( "Denmark", 'sportspress' ),
325
  'dji' => __( "Djibouti", 'sportspress' ),
326
  'dma' => __( "Dominica", 'sportspress' ),
395
  'mdv' => __( "Maldives", 'sportspress' ),
396
  'mex' => __( "Mexico", 'sportspress' ),
397
  'mhl' => __( "Marshall Islands", 'sportspress' ),
398
+ 'mkd' => __( "North Macedonia", 'sportspress' ),
399
  'mli' => __( "Mali", 'sportspress' ),
400
  'mlt' => __( "Malta", 'sportspress' ),
401
  'mne' => __( "Montenegro", 'sportspress' ),
405
  'msr' => __( "Montserrat", 'sportspress' ),
406
  'mtn' => __( "Mauritania", 'sportspress' ),
407
  'mwi' => __( "Malawi", 'sportspress' ),
408
+ 'mya' => __( "Myanmar", 'sportspress' ),
409
  'nam' => __( "Namibia", 'sportspress' ),
410
  'nca' => __( "Nicaragua", 'sportspress' ),
411
  'ncl' => __( "New Caledonia", 'sportspress' ),
456
  'svk' => __( "Slovakia", 'sportspress' ),
457
  'svn' => __( "Slovenia", 'sportspress' ),
458
  'swe' => __( "Sweden", 'sportspress' ),
459
+ 'swz' => __( "Eswatini", 'sportspress' ),
460
  'syr' => __( "Syria", 'sportspress' ),
461
  'tah' => __( "Tahiti", 'sportspress' ),
462
  'tan' => __( "Tanzania", 'sportspress' ),
includes/class-sp-player-list.php CHANGED
@@ -5,7 +5,7 @@
5
  * The SportsPress player list class handles individual player list data.
6
  *
7
  * @class SP_Player_List
8
- * @version 2.7.1
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
@@ -374,6 +374,24 @@ class SP_Player_List extends SP_Secondary_Post {
374
  'terms' => $season_ids
375
  );
376
  endif;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
377
 
378
  if ( $this->date !== 0 ):
379
  if ( $this->date == 'w' ):
@@ -412,6 +430,7 @@ class SP_Player_List extends SP_Secondary_Post {
412
 
413
  // Add all team performance
414
  if ( is_array( $team_performance ) ): foreach ( $team_performance as $team_id => $players ):
 
415
  if ( is_array( $players ) ): foreach ( $players as $player_id => $player_performance ):
416
  if ( array_key_exists( $player_id, $totals ) && is_array( $totals[ $player_id ] ) ):
417
 
5
  * The SportsPress player list class handles individual player list data.
6
  *
7
  * @class SP_Player_List
8
+ * @version 2.7.3
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
374
  'terms' => $season_ids
375
  );
376
  endif;
377
+
378
+ $team_key = 'sp_team';
379
+ if ( $team ):
380
+ switch ( $era ):
381
+ case 'current':
382
+ $team_key = 'sp_current_team';
383
+ break;
384
+ case 'past':
385
+ $team_key = 'sp_past_team';
386
+ break;
387
+ endswitch;
388
+ $args['meta_query'][] = array(
389
+ array(
390
+ 'key' => $team_key,
391
+ 'value' => $team
392
+ ),
393
+ );
394
+ endif;
395
 
396
  if ( $this->date !== 0 ):
397
  if ( $this->date == 'w' ):
430
 
431
  // Add all team performance
432
  if ( is_array( $team_performance ) ): foreach ( $team_performance as $team_id => $players ):
433
+ if ( $team && $team_id != $team ) continue;
434
  if ( is_array( $players ) ): foreach ( $players as $player_id => $player_performance ):
435
  if ( array_key_exists( $player_id, $totals ) && is_array( $totals[ $player_id ] ) ):
436
 
includes/class-sp-player.php CHANGED
@@ -5,7 +5,7 @@
5
  * The SportsPress player class handles individual player data.
6
  *
7
  * @class SP_Player
8
- * @version 2.7
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
@@ -802,13 +802,9 @@ class SP_Player extends SP_Custom_Post {
802
 
803
  $labels = array();
804
 
805
- if ( 'no' === get_option( 'sportspress_player_show_statistics', 'yes' ) ) {
806
- $merged = array();
807
- } else {
808
- $labels['name'] = __( 'Season', 'sportspress' );
809
- $labels['team'] = __( 'Team', 'sportspress' );
810
- }
811
-
812
  if ( 'no' === get_option( 'sportspress_player_show_total', 'no' ) ) {
813
  unset( $merged[-1] );
814
  }
5
  * The SportsPress player class handles individual player data.
6
  *
7
  * @class SP_Player
8
+ * @version 2.7.3
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
802
 
803
  $labels = array();
804
 
805
+ $labels['name'] = __( 'Season', 'sportspress' );
806
+ $labels['team'] = __( 'Team', 'sportspress' );
807
+
 
 
 
 
808
  if ( 'no' === get_option( 'sportspress_player_show_total', 'no' ) ) {
809
  unset( $merged[-1] );
810
  }
includes/sp-formatting-functions.php CHANGED
@@ -7,7 +7,7 @@
7
  * @author ThemeBoy
8
  * @category Core
9
  * @package SportsPress/Functions
10
- * @version 2.4
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -189,9 +189,9 @@ if ( ! function_exists( 'sp_rgb_from_hex' ) ) {
189
  // Convert shorthand colors to full format, e.g. "FFF" -> "FFFFFF"
190
  $color = preg_replace( '~^(.)(.)(.)$~', '$1$1$2$2$3$3', $color );
191
 
192
- $rgb['R'] = hexdec( $color{0}.$color{1} );
193
- $rgb['G'] = hexdec( $color{2}.$color{3} );
194
- $rgb['B'] = hexdec( $color{4}.$color{5} );
195
  return $rgb;
196
  }
197
  }
7
  * @author ThemeBoy
8
  * @category Core
9
  * @package SportsPress/Functions
10
+ * @version 2.7.3
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
189
  // Convert shorthand colors to full format, e.g. "FFF" -> "FFFFFF"
190
  $color = preg_replace( '~^(.)(.)(.)$~', '$1$1$2$2$3$3', $color );
191
 
192
+ $rgb['R'] = hexdec( $color[0].$color[1] );
193
+ $rgb['G'] = hexdec( $color[2].$color[3] );
194
+ $rgb['B'] = hexdec( $color[4].$color[5] );
195
  return $rgb;
196
  }
197
  }
modules/sportspress-player-assignments.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://themeboy.com/
5
  Description: Add player assignments support to SportsPress.
6
  Author: Savvas
7
  Author URI: http://themeboy.com/
8
- Version: 2.6.10
9
  */
10
  // Exit if accessed directly
11
  if ( ! defined( 'ABSPATH' ) ) exit;
@@ -14,7 +14,7 @@ if ( ! class_exists( 'SportsPress_Player_Assignments' ) ) :
14
  * Main SportsPress Player Assignments Class
15
  *
16
  * @class SportsPress_Player_Assignments
17
- * @version 2.6.10
18
  */
19
  class SportsPress_Player_Assignments {
20
  /**
@@ -36,7 +36,7 @@ class SportsPress_Player_Assignments {
36
  */
37
  private function define_constants() {
38
  if ( !defined( 'SP_PLAYER_ASSIGNMENTS_VERSION' ) )
39
- define( 'SP_PLAYER_ASSIGNMENTS_VERSION', '2.6.10' );
40
  if ( !defined( 'SP_PLAYER_ASSIGNMENTS_URL' ) )
41
  define( 'SP_PLAYER_ASSIGNMENTS_URL', plugin_dir_url( __FILE__ ) );
42
  if ( !defined( 'SP_PLAYER_ASSIGNMENTS_DIR' ) )
@@ -78,7 +78,7 @@ class SportsPress_Player_Assignments {
78
  if ( 'sp_season' === sp_array_value( $param, 'taxonomy' ) ) $season_ids = sp_array_value( $param, 'terms', array() );
79
  }
80
 
81
- if ( empty( $league_ids ) || empty( $season_ids ) ) return $args;
82
 
83
  $args['meta_query'][] = array(
84
  'key' => 'sp_assignments',
5
  Description: Add player assignments support to SportsPress.
6
  Author: Savvas
7
  Author URI: http://themeboy.com/
8
+ Version: 2.7.3
9
  */
10
  // Exit if accessed directly
11
  if ( ! defined( 'ABSPATH' ) ) exit;
14
  * Main SportsPress Player Assignments Class
15
  *
16
  * @class SportsPress_Player_Assignments
17
+ * @version 2.7.3
18
  */
19
  class SportsPress_Player_Assignments {
20
  /**
36
  */
37
  private function define_constants() {
38
  if ( !defined( 'SP_PLAYER_ASSIGNMENTS_VERSION' ) )
39
+ define( 'SP_PLAYER_ASSIGNMENTS_VERSION', '2.7.3' );
40
  if ( !defined( 'SP_PLAYER_ASSIGNMENTS_URL' ) )
41
  define( 'SP_PLAYER_ASSIGNMENTS_URL', plugin_dir_url( __FILE__ ) );
42
  if ( !defined( 'SP_PLAYER_ASSIGNMENTS_DIR' ) )
78
  if ( 'sp_season' === sp_array_value( $param, 'taxonomy' ) ) $season_ids = sp_array_value( $param, 'terms', array() );
79
  }
80
 
81
+ if ( empty( $league_ids ) && empty( $season_ids ) ) return $args;
82
 
83
  $args['meta_query'][] = array(
84
  'key' => 'sp_assignments',
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: ThemeBoy, brianmiyaji, aylaview, savvasha, nabil_kadimi, rochester
3
  Tags: calendars, club, club management, esports, events, fixtures, leagues, league management, sports, sports club, sports data, team rosters
4
  Donate link: http://tboy.co/donate
5
  Requires at least: 3.8
6
- Tested up to: 5.3
7
- Stable tag: 2.7.2
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -240,6 +240,19 @@ When you upgrade to one of the SportsPress Pro licenses, you can simply activate
240
 
241
  == Changelog ==
242
 
 
 
 
 
 
 
 
 
 
 
 
 
 
243
  = 2.7.2 =
244
  * Tweak - Sanitize delimiter field in event settings.
245
 
3
  Tags: calendars, club, club management, esports, events, fixtures, leagues, league management, sports, sports club, sports data, team rosters
4
  Donate link: http://tboy.co/donate
5
  Requires at least: 3.8
6
+ Tested up to: 5.5
7
+ Stable tag: 2.7.3
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
240
 
241
  == Changelog ==
242
 
243
+ = 2.7.3 =
244
+ * Compatibility - Tested for compatibility with WordPress 5.5 with changes made where necessary.
245
+ * Tweak - Avoid showing minutes box for subs when not needed.
246
+ * Tweak - Improve filtering speed for queries without leagues or seasons.
247
+ * Tweak - Apply reverse order setting in event lists.
248
+ * Tweak - Enable filtering a player's events played on a specific team.
249
+ * Fix - Include future events in REST API for WordPress 5.5.
250
+ * Fix - Enable updating player metrics using the REST API.
251
+ * Fix - Deprecated code for PHP 7.4.
252
+ * Fix - Elementor compatibility.
253
+ * Localization - Update country names for Czechia, North Macedonia, Myanmar, and Eswatini.
254
+ * Localization - Adjust RTL stylesheet for event performance icons.
255
+
256
  = 2.7.2 =
257
  * Tweak - Sanitize delimiter field in event settings.
258
 
sportspress.php CHANGED
@@ -3,11 +3,11 @@
3
  * Plugin Name: SportsPress
4
  * Plugin URI: http://themeboy.com/sportspress/
5
  * Description: Manage your club and its players, staff, events, league tables, and player lists.
6
- * Version: 2.7.2
7
  * Author: ThemeBoy
8
  * Author URI: http://themeboy.com
9
  * Requires at least: 3.8
10
- * Tested up to: 5.3
11
  *
12
  * Text Domain: sportspress
13
  * Domain Path: /languages/
@@ -26,14 +26,14 @@ if ( ! class_exists( 'SportsPress' ) ) :
26
  * Main SportsPress Class
27
  *
28
  * @class SportsPress
29
- * @version 2.7.2
30
  */
31
  final class SportsPress {
32
 
33
  /**
34
  * @var string
35
  */
36
- public $version = '2.7.2';
37
 
38
  /**
39
  * @var SportsPress The single instance of the class
3
  * Plugin Name: SportsPress
4
  * Plugin URI: http://themeboy.com/sportspress/
5
  * Description: Manage your club and its players, staff, events, league tables, and player lists.
6
+ * Version: 2.7.3
7
  * Author: ThemeBoy
8
  * Author URI: http://themeboy.com
9
  * Requires at least: 3.8
10
+ * Tested up to: 5.5
11
  *
12
  * Text Domain: sportspress
13
  * Domain Path: /languages/
26
  * Main SportsPress Class
27
  *
28
  * @class SportsPress
29
+ * @version 2.7.3
30
  */
31
  final class SportsPress {
32
 
33
  /**
34
  * @var string
35
  */
36
+ public $version = '2.7.3';
37
 
38
  /**
39
  * @var SportsPress The single instance of the class
templates/event-blocks.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 2.6.15
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -172,7 +172,7 @@ if ( $title )
172
  <tr class="sp-row sp-post<?php echo ( $i % 2 == 0 ? ' alternate' : '' ); ?>" itemscope itemtype="http://schema.org/SportsEvent">
173
  <td>
174
  <?php do_action( 'sportspress_event_blocks_before', $event, $usecolumns ); ?>
175
- <?php echo implode( $logos, ' ' ); ?>
176
  <time class="sp-event-date" datetime="<?php echo $event->post_date; ?>" itemprop="startDate" content="<?php echo mysql2date( 'Y-m-d\TH:iP', $event->post_date ); ?>">
177
  <?php echo sp_add_link( get_the_time( get_option( 'date_format' ), $event ), $permalink, $link_events ); ?>
178
  </time>
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.7.3
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
172
  <tr class="sp-row sp-post<?php echo ( $i % 2 == 0 ? ' alternate' : '' ); ?>" itemscope itemtype="http://schema.org/SportsEvent">
173
  <td>
174
  <?php do_action( 'sportspress_event_blocks_before', $event, $usecolumns ); ?>
175
+ <?php echo implode( ' ', $logos ); ?>
176
  <time class="sp-event-date" datetime="<?php echo $event->post_date; ?>" itemprop="startDate" content="<?php echo mysql2date( 'Y-m-d\TH:iP', $event->post_date ); ?>">
177
  <?php echo sp_add_link( get_the_time( get_option( 'date_format' ), $event ), $permalink, $link_events ); ?>
178
  </time>
templates/event-list.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 2.7.1
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -204,6 +204,11 @@ $identifier = uniqid( 'eventlist_' );
204
 
205
  $main_results = apply_filters( 'sportspress_event_list_main_results', sp_get_main_results( $event ), $event->ID );
206
 
 
 
 
 
 
207
  $teams_output = '';
208
  $team_class = '';
209
  $teams_array = array();
@@ -376,7 +381,7 @@ $identifier = uniqid( 'eventlist_' );
376
  echo '<td class="data-league" data-label="'.__( 'League', 'sportspress' ).'">';
377
  $leagues = get_the_terms( $event->ID, 'sp_league' );
378
  if ( $leagues ):
379
- echo implode( wp_list_pluck( $leagues, 'name' ), ', ' );
380
  endif;
381
  echo '</td>';
382
  endif;
@@ -385,7 +390,7 @@ $identifier = uniqid( 'eventlist_' );
385
  echo '<td class="data-season" data-label="'.__( 'Season', 'sportspress' ).'">';
386
  $seasons = get_the_terms( $event->ID, 'sp_season' );
387
  if ( $seasons ):
388
- echo implode( wp_list_pluck( $seasons, 'name' ), ', ' );
389
  endif;
390
  echo '</td>';
391
  endif;
@@ -398,7 +403,7 @@ $identifier = uniqid( 'eventlist_' );
398
  else:
399
  $venues = get_the_terms( $event->ID, 'sp_venue' );
400
  if ( $venues ):
401
- echo implode( wp_list_pluck( $venues, 'name' ), ', ' );
402
  endif;
403
  endif;
404
  echo '</div>';
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.7.3
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
204
 
205
  $main_results = apply_filters( 'sportspress_event_list_main_results', sp_get_main_results( $event ), $event->ID );
206
 
207
+ $reverse_teams = get_option( 'sportspress_event_reverse_teams', 'no' ) === 'yes' ? true : false;
208
+ if ( $reverse_teams ) {
209
+ $main_results = array_reverse( $main_results, true );
210
+ }
211
+
212
  $teams_output = '';
213
  $team_class = '';
214
  $teams_array = array();
381
  echo '<td class="data-league" data-label="'.__( 'League', 'sportspress' ).'">';
382
  $leagues = get_the_terms( $event->ID, 'sp_league' );
383
  if ( $leagues ):
384
+ echo implode( ', ', wp_list_pluck( $leagues, 'name' ) );
385
  endif;
386
  echo '</td>';
387
  endif;
390
  echo '<td class="data-season" data-label="'.__( 'Season', 'sportspress' ).'">';
391
  $seasons = get_the_terms( $event->ID, 'sp_season' );
392
  if ( $seasons ):
393
+ echo implode( ', ', wp_list_pluck( $seasons, 'name' ) );
394
  endif;
395
  echo '</td>';
396
  endif;
403
  else:
404
  $venues = get_the_terms( $event->ID, 'sp_venue' );
405
  if ( $venues ):
406
+ echo implode( ', ', wp_list_pluck( $venues, 'name' ) );
407
  endif;
408
  endif;
409
  echo '</div>';