SportsPress – Sports Club & League Manager - Version 2.6.5

Version Description

  • Tweak - Increase coverage of reverse teams option.
  • Tweak - Improve sorting of leagues, positions, and seasons.
  • Localization - Additional legacy country code for Greece.
  • Fix - Broken post author select on certain pages.
  • Fix - Google Calendar link protocol.
Download this release

Release Info

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

Code changes from version 2.6.4 to 2.6.5

assets/js/admin/sportspress-admin.js CHANGED
@@ -14,7 +14,7 @@ jQuery(document).ready(function($){
14
  });
15
 
16
  // Chosen select
17
- $(".chosen-select, #poststuff #post_author_override").chosen({
18
  allow_single_deselect: true,
19
  search_contains: true,
20
  single_backstroke_delete: false,
14
  });
15
 
16
  // Chosen select
17
+ $(".chosen-select").chosen({
18
  allow_single_deselect: true,
19
  search_contains: true,
20
  single_backstroke_delete: false,
changelog.txt CHANGED
@@ -1,5 +1,12 @@
1
  == SportsPress Changelog ==
2
 
 
 
 
 
 
 
 
3
  = 2.6.4 =
4
  * Fix - Undefined variable notice in player list.
5
 
1
  == SportsPress Changelog ==
2
 
3
+ = 2.6.5 =
4
+ * Tweak - Increase coverage of reverse teams option.
5
+ * Tweak - Improve sorting of leagues, positions, and seasons.
6
+ * Localization - Additional legacy country code for Greece.
7
+ * Fix - Broken post author select on certain pages.
8
+ * Fix - Google Calendar link protocol.
9
+
10
  = 2.6.4 =
11
  * Fix - Undefined variable notice in player list.
12
 
includes/abstracts/abstract-sp-custom-post.php CHANGED
@@ -5,7 +5,7 @@
5
  * The SportsPress custom post class handles individual post data.
6
  *
7
  * @class SP_Custom_Post
8
- * @version 0.8
9
  * @package SportsPress/Abstracts
10
  * @category Abstract Class
11
  * @author ThemeBoy
@@ -71,4 +71,19 @@ abstract class SP_Custom_Post {
71
  public function get_post_data() {
72
  return $this->post;
73
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
  }
5
  * The SportsPress custom post class handles individual post data.
6
  *
7
  * @class SP_Custom_Post
8
+ * @version 2.6.5
9
  * @package SportsPress/Abstracts
10
  * @category Abstract Class
11
  * @author ThemeBoy
71
  public function get_post_data() {
72
  return $this->post;
73
  }
74
+
75
+ /**
76
+ * Get terms sorted by order.
77
+ *
78
+ * @access public
79
+ * @param string $taxonomy The taxonomy.
80
+ * @return array|false|WP_Error See `get_the_terms()`
81
+ */
82
+ public function get_terms_sorted_by_sp_order( $taxonomy ) {
83
+ $terms = get_the_terms( $this->ID, $taxonomy );
84
+ if ( $terms ) {
85
+ usort( $terms, 'sp_sort_terms' );
86
+ }
87
+ return $terms;
88
+ }
89
  }
includes/admin/class-sp-admin-assets.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin
8
- * @version 2.6
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -33,7 +33,7 @@ class SP_Admin_Assets {
33
  wp_enqueue_style( 'sportspress-admin-menu-styles', SP()->plugin_url() . '/assets/css/menu.css', array(), SP_VERSION );
34
 
35
  $screen = get_current_screen();
36
-
37
  if ( in_array( $screen->id, sp_get_screen_ids() ) ) {
38
  // Admin styles for SP pages only
39
  wp_enqueue_style( 'jquery-chosen', SP()->plugin_url() . '/assets/css/chosen.css', array(), '1.1.0' );
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin
8
+ * @version 2.6.5
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
33
  wp_enqueue_style( 'sportspress-admin-menu-styles', SP()->plugin_url() . '/assets/css/menu.css', array(), SP_VERSION );
34
 
35
  $screen = get_current_screen();
36
+
37
  if ( in_array( $screen->id, sp_get_screen_ids() ) ) {
38
  // Admin styles for SP pages only
39
  wp_enqueue_style( 'jquery-chosen', SP()->plugin_url() . '/assets/css/chosen.css', array(), '1.1.0' );
includes/admin/post-types/class-sp-admin-cpt-event.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Post_Types
8
- * @version 2.6
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -102,6 +102,11 @@ class SP_Admin_CPT_Event extends SP_Admin_CPT {
102
 
103
  $team_names = array_unique( $team_names );
104
 
 
 
 
 
 
105
  $data['post_title'] = implode( ' ' . get_option( 'sportspress_event_teams_delimiter', 'vs' ) . ' ', $team_names );
106
 
107
  endif;
@@ -174,6 +179,10 @@ class SP_Admin_CPT_Event extends SP_Admin_CPT {
174
  $teams = (array)get_post_meta( $post_id, 'sp_team', false );
175
  $teams = array_filter( $teams );
176
  $teams = array_unique( $teams );
 
 
 
 
177
  if ( empty( $teams ) ):
178
  echo '—';
179
  else:
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Post_Types
8
+ * @version 2.6.5
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
102
 
103
  $team_names = array_unique( $team_names );
104
 
105
+ $reverse_teams = get_option( 'sportspress_event_reverse_teams', 'no' ) === 'yes' ? true : false;
106
+ if ( $reverse_teams ) {
107
+ $team_names = array_reverse( $team_names );
108
+ }
109
+
110
  $data['post_title'] = implode( ' ' . get_option( 'sportspress_event_teams_delimiter', 'vs' ) . ' ', $team_names );
111
 
112
  endif;
179
  $teams = (array)get_post_meta( $post_id, 'sp_team', false );
180
  $teams = array_filter( $teams );
181
  $teams = array_unique( $teams );
182
+ $reverse_teams = get_option( 'sportspress_event_reverse_teams', 'no' ) === 'yes' ? true : false;
183
+ if ( $reverse_teams ) {
184
+ $teams = array_reverse( $teams , true );
185
+ }
186
  if ( empty( $teams ) ):
187
  echo '—';
188
  else:
includes/admin/post-types/meta-boxes/class-sp-meta-box-player-statistics.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
- * @version 2.6
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -20,20 +20,7 @@ class SP_Meta_Box_Player_Statistics {
20
  */
21
  public static function output( $post ) {
22
  $player = new SP_Player( $post );
23
- $args = array(
24
- 'meta_query' => array(
25
- 'relation' => 'OR',
26
- array(
27
- 'key' => 'sp_order',
28
- 'compare' => 'NOT EXISTS',
29
- ),
30
- array(
31
- 'key' => 'sp_order',
32
- 'compare' => 'EXISTS',
33
- ),
34
- ),
35
- );
36
- $leagues = get_the_terms( $post->ID, 'sp_league', $args );
37
  $league_num = sizeof( $leagues );
38
  $sections = get_option( 'sportspress_player_performance_sections', -1 );
39
  $show_career_totals = 'yes' === get_option( 'sportspress_player_show_career_total', 'no' ) ? true : false;
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
+ * @version 2.6.5
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
20
  */
21
  public static function output( $post ) {
22
  $player = new SP_Player( $post );
23
+ $leagues = $player->get_terms_sorted_by_sp_order( 'sp_league' );
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  $league_num = sizeof( $leagues );
25
  $sections = get_option( 'sportspress_player_performance_sections', -1 );
26
  $show_career_totals = 'yes' === get_option( 'sportspress_player_show_career_total', 'no' ) ? true : false;
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.2
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
@@ -546,6 +546,7 @@ class SP_Countries {
546
  'ee' => 'est',
547
  'eg' => 'egy',
548
  'eh' => 'esh',
 
549
  'en' => 'end',
550
  'er' => 'eri',
551
  'es' => 'esp',
5
  * The SportsPress countries class stores continent/country data.
6
  *
7
  * @class SP_Countries
8
+ * @version 2.6.5
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
546
  'ee' => 'est',
547
  'eg' => 'egy',
548
  'eh' => 'esh',
549
+ 'el' => 'gre',
550
  'en' => 'end',
551
  'er' => 'eri',
552
  'es' => 'esp',
includes/class-sp-event.php CHANGED
@@ -5,7 +5,7 @@
5
  * The SportsPress event class handles individual event data.
6
  *
7
  * @class SP_Event
8
- * @version 2.6
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
@@ -89,6 +89,10 @@ class SP_Event extends SP_Custom_Post{
89
 
90
  public function performance( $admin = false ) {
91
  $teams = get_post_meta( $this->ID, 'sp_team', false );
 
 
 
 
92
  $performance = (array)get_post_meta( $this->ID, 'sp_players', true );
93
 
94
  $args = array(
5
  * The SportsPress event class handles individual event data.
6
  *
7
  * @class SP_Event
8
+ * @version 2.6.5
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
89
 
90
  public function performance( $admin = false ) {
91
  $teams = get_post_meta( $this->ID, 'sp_team', false );
92
+ if ( 'yes' === get_option( 'sportspress_event_reverse_teams', 'no' ) ) {
93
+ $teams = array_reverse( $teams, true );
94
+ }
95
+
96
  $performance = (array)get_post_meta( $this->ID, 'sp_players', true );
97
 
98
  $args = array(
includes/class-sp-feeds.php CHANGED
@@ -3,7 +3,7 @@
3
  * SportsPress Feeds Class
4
  *
5
  * @class SP_Feeds
6
- * @version 1.5
7
  * @package SportsPress/Classes
8
  * @category Class
9
  * @author ThemeBoy
@@ -33,6 +33,7 @@ class SP_Feeds {
33
  ),
34
  'google' => array(
35
  'name' => __( 'Google', 'sportspress' ),
 
36
  'prefix' => 'http://www.google.com/calendar/render?cid=',
37
  ),
38
  ),
3
  * SportsPress Feeds Class
4
  *
5
  * @class SP_Feeds
6
+ * @version 2.6.5
7
  * @package SportsPress/Classes
8
  * @category Class
9
  * @author ThemeBoy
33
  ),
34
  'google' => array(
35
  'name' => __( 'Google', 'sportspress' ),
36
+ 'protocol' => 'webcal',
37
  'prefix' => 'http://www.google.com/calendar/render?cid=',
38
  ),
39
  ),
includes/class-sp-league-table.php CHANGED
@@ -5,7 +5,7 @@
5
  * The SportsPress league table class handles individual league table data.
6
  *
7
  * @class SP_League_Table
8
- * @version 2.6
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
@@ -550,6 +550,12 @@ class SP_League_Table extends SP_Secondary_Post {
550
  $totals[ $team_id ]['last10'] = $last10;
551
  endforeach;
552
 
 
 
 
 
 
 
553
  foreach ( $homerecords as $team_id => $homerecord ):
554
  // Add home record to totals
555
  $totals[ $team_id ]['homerecord'] = $homerecord;
5
  * The SportsPress league table class handles individual league table data.
6
  *
7
  * @class SP_League_Table
8
+ * @version 2.6.5
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
550
  $totals[ $team_id ]['last10'] = $last10;
551
  endforeach;
552
 
553
+ // Reverse home and away records when "Reverse Teams" is enabled.
554
+ $reverse_teams = get_option( 'sportspress_event_reverse_teams', 'no' ) === 'yes' ? true : false;
555
+ if ( $reverse_teams ) {
556
+ list( $homerecords, $awayrecords ) = array( $awayrecords, $homerecords );
557
+ }
558
+
559
  foreach ( $homerecords as $team_id => $homerecord ):
560
  // Add home record to totals
561
  $totals[ $team_id ]['homerecord'] = $homerecord;
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.6.3
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
@@ -13,33 +13,33 @@
13
  class SP_Player extends SP_Custom_Post {
14
 
15
  /**
16
- * Returns positions
17
  *
18
  * @access public
19
  * @return array
20
  */
21
  public function positions() {
22
- return get_the_terms( $this->ID, 'sp_position' );
23
  }
24
 
25
  /**
26
- * Returns leagues
27
  *
28
  * @access public
29
  * @return array
30
  */
31
  public function leagues() {
32
- return get_the_terms( $this->ID, 'sp_league' );
33
  }
34
 
35
  /**
36
- * Returns seasons
37
  *
38
  * @access public
39
  * @return array
40
  */
41
  public function seasons() {
42
- return get_the_terms( $this->ID, 'sp_season' );
43
  }
44
 
45
  /**
@@ -110,23 +110,11 @@ class SP_Player extends SP_Custom_Post {
110
  * @return array
111
  */
112
  public function data( $league_id, $admin = false, $section = -1 ) {
113
- $args = array(
114
- 'meta_query' => array(
115
- 'relation' => 'OR',
116
- array(
117
- 'key' => 'sp_order',
118
- 'compare' => 'NOT EXISTS',
119
- ),
120
- array(
121
- 'key' => 'sp_order',
122
- 'compare' => 'EXISTS',
123
- ),
124
- ),
125
- );
126
- $seasons = (array)get_the_terms( $this->ID, 'sp_season', $args );
127
  $metrics = (array)get_post_meta( $this->ID, 'sp_metrics', true );
128
  $stats = (array)get_post_meta( $this->ID, 'sp_statistics', true );
129
  $leagues = (array) sp_array_value( (array)get_post_meta( $this->ID, 'sp_leagues', true ), $league_id );
 
130
  $manual_columns = 'manual' == get_option( 'sportspress_player_columns', 'auto' ) ? true : false;
131
 
132
  $season_ids = array_filter(wp_list_pluck( $seasons, 'term_id' ));
@@ -136,7 +124,7 @@ class SP_Player extends SP_Custom_Post {
136
  }
137
 
138
  $leagues = array_replace( $season_order, $leagues );
139
-
140
  // Get performance labels
141
  $args = array(
142
  'post_type' => array( 'sp_performance' ),
5
  * The SportsPress player class handles individual player data.
6
  *
7
  * @class SP_Player
8
+ * @version 2.6.5
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
13
  class SP_Player extends SP_Custom_Post {
14
 
15
  /**
16
+ * Returns positions sorted by `sp_order`.
17
  *
18
  * @access public
19
  * @return array
20
  */
21
  public function positions() {
22
+ return $this->get_terms_sorted_by_sp_order( 'sp_position' );
23
  }
24
 
25
  /**
26
+ * Returns leagues sorted by `sp_order`.
27
  *
28
  * @access public
29
  * @return array
30
  */
31
  public function leagues() {
32
+ return $this->get_terms_sorted_by_sp_order( 'sp_league' );
33
  }
34
 
35
  /**
36
+ * Returns seasons sorted by `sp_order`.
37
  *
38
  * @access public
39
  * @return array
40
  */
41
  public function seasons() {
42
+ return $this->get_terms_sorted_by_sp_order( 'sp_season' );
43
  }
44
 
45
  /**
110
  * @return array
111
  */
112
  public function data( $league_id, $admin = false, $section = -1 ) {
113
+ $seasons = (array) $this->get_terms_sorted_by_sp_order( 'sp_season' );
 
 
 
 
 
 
 
 
 
 
 
 
 
114
  $metrics = (array)get_post_meta( $this->ID, 'sp_metrics', true );
115
  $stats = (array)get_post_meta( $this->ID, 'sp_statistics', true );
116
  $leagues = (array) sp_array_value( (array)get_post_meta( $this->ID, 'sp_leagues', true ), $league_id );
117
+ uksort( $leagues, 'sp_sort_terms' );
118
  $manual_columns = 'manual' == get_option( 'sportspress_player_columns', 'auto' ) ? true : false;
119
 
120
  $season_ids = array_filter(wp_list_pluck( $seasons, 'term_id' ));
124
  }
125
 
126
  $leagues = array_replace( $season_order, $leagues );
127
+
128
  // Get performance labels
129
  $args = array(
130
  'post_type' => array( 'sp_performance' ),
includes/sp-api-functions.php CHANGED
@@ -7,7 +7,7 @@
7
  * @author ThemeBoy
8
  * @category Core
9
  * @package SportsPress/Functions
10
- * @version 2.6.3
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -111,7 +111,11 @@ function sp_get_main_result_option() {
111
 
112
  function sp_get_main_results( $post = 0 ) {
113
  $event = new SP_Event( $post );
114
- return $event->main_results();
 
 
 
 
115
  }
116
 
117
  function sp_the_main_results( $post = 0, $delimiter = '-' ) {
7
  * @author ThemeBoy
8
  * @category Core
9
  * @package SportsPress/Functions
10
+ * @version 2.6.5
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
111
 
112
  function sp_get_main_results( $post = 0 ) {
113
  $event = new SP_Event( $post );
114
+ $results = $event->main_results();
115
+ if ( is_array( $results ) && get_option( 'sportspress_event_reverse_teams' ) === 'yes' ) {
116
+ $results = array_reverse( $results );
117
+ }
118
+ return $results;
119
  }
120
 
121
  function sp_the_main_results( $post = 0, $delimiter = '-' ) {
includes/sp-core-functions.php CHANGED
@@ -7,7 +7,7 @@
7
  * @author ThemeBoy
8
  * @category Core
9
  * @package SportsPress/Functions
10
- * @version 2.6.3
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -1463,6 +1463,26 @@ if ( !function_exists( 'sp_sort_table_teams' ) ) {
1463
  }
1464
  }
1465
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1466
  if ( !function_exists( 'sp_get_next_event' ) ) {
1467
  function sp_get_next_event( $args = array() ) {
1468
  $options = array(
7
  * @author ThemeBoy
8
  * @category Core
9
  * @package SportsPress/Functions
10
+ * @version 2.6.5
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
1463
  }
1464
  }
1465
 
1466
+ if ( ! function_exists( 'sp_sort_terms' ) ) {
1467
+
1468
+ /**
1469
+ * Sorts terms by `sp_order`.
1470
+ *
1471
+ * @param int|object $a Term ID or term.
1472
+ * @param int|object $b Term ID or term.
1473
+ * @return int Sorting order.
1474
+ */
1475
+ function sp_sort_terms( $a, $b ) {
1476
+ if ( is_int( $a ) ) {
1477
+ $a = get_term( $a );
1478
+ }
1479
+ if ( is_int( $b ) ) {
1480
+ $b = get_term( $b );
1481
+ }
1482
+ return get_term_meta( $a->term_id, 'sp_order', true ) > get_term_meta( $b->term_id, 'sp_order', true );
1483
+ }
1484
+ }
1485
+
1486
  if ( !function_exists( 'sp_get_next_event' ) ) {
1487
  function sp_get_next_event( $args = array() ) {
1488
  $options = array(
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === SportsPress - Sports Club & League Manager ===
2
- Contributors: ThemeBoy, brianmiyaji, aylaview, savvasha
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: 4.9
7
- Stable tag: 2.6.4
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -237,6 +237,13 @@ When you upgrade to one of the SportsPress Pro licenses, you can simply activate
237
 
238
  == Changelog ==
239
 
 
 
 
 
 
 
 
240
  = 2.6.4 =
241
  * Fix - Undefined variable notice in player list.
242
 
1
  === SportsPress - Sports Club & League Manager ===
2
+ Contributors: ThemeBoy, brianmiyaji, aylaview, savvasha, kadimi
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: 4.9
7
+ Stable tag: 2.6.5
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
237
 
238
  == Changelog ==
239
 
240
+ = 2.6.5 =
241
+ * Tweak - Increase coverage of reverse teams option.
242
+ * Tweak - Improve sorting of leagues, positions, and seasons.
243
+ * Localization - Additional legacy country code for Greece.
244
+ * Fix - Broken post author select on certain pages.
245
+ * Fix - Google Calendar link protocol.
246
+
247
  = 2.6.4 =
248
  * Fix - Undefined variable notice in player list.
249
 
sportspress.php CHANGED
@@ -3,7 +3,7 @@
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.6.4
7
  * Author: ThemeBoy
8
  * Author URI: http://themeboy.com
9
  * Requires at least: 3.8
@@ -26,14 +26,14 @@ if ( ! class_exists( 'SportsPress' ) ) :
26
  * Main SportsPress Class
27
  *
28
  * @class SportsPress
29
- * @version 2.6.4
30
  */
31
  final class SportsPress {
32
 
33
  /**
34
  * @var string
35
  */
36
- public $version = '2.6.4';
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.6.5
7
  * Author: ThemeBoy
8
  * Author URI: http://themeboy.com
9
  * Requires at least: 3.8
26
  * Main SportsPress Class
27
  *
28
  * @class SportsPress
29
+ * @version 2.6.5
30
  */
31
  final class SportsPress {
32
 
33
  /**
34
  * @var string
35
  */
36
+ public $version = '2.6.5';
37
 
38
  /**
39
  * @var SportsPress The single instance of the class
templates/countdown.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 2.6
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.6.5
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
templates/event-logos.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 2.6
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -15,6 +15,10 @@ if ( ! isset( $id ) )
15
 
16
  $teams = (array) get_post_meta( $id, 'sp_team' );
17
  $teams = array_filter( $teams, 'sp_filter_positive' );
 
 
 
 
18
 
19
  if ( ! $teams ) return;
20
 
@@ -46,4 +50,4 @@ sp_get_template( 'event-logos-' . $layout . '.php', array(
46
  'link_teams' => $link_teams,
47
  ) );
48
 
49
- do_action( 'sportspress_after_event_logos', $id );
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.6.5
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
15
 
16
  $teams = (array) get_post_meta( $id, 'sp_team' );
17
  $teams = array_filter( $teams, 'sp_filter_positive' );
18
+ $reverse_teams = get_option( 'sportspress_event_reverse_teams', 'no' ) === 'yes' ? true : false;
19
+ if ( $reverse_teams ) {
20
+ $teams = array_reverse( $teams );
21
+ }
22
 
23
  if ( ! $teams ) return;
24
 
50
  'link_teams' => $link_teams,
51
  ) );
52
 
53
+ do_action( 'sportspress_after_event_logos', $id );
templates/team-events.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 2.2
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -16,6 +16,14 @@ $format = get_option( 'sportspress_team_events_format', 'blocks' );
16
  if ( 'calendar' === $format )
17
  sp_get_template( 'event-calendar.php', array( 'team' => $id ) );
18
  elseif ( 'list' === $format )
19
- sp_get_template( 'event-list.php', array( 'team' => $id, 'order' => 'DESC', 'title_format' => 'homeaway', 'time_format' => 'separate', 'columns' => array( 'event', 'time', 'results' ) ) );
 
 
 
 
 
 
 
 
20
  else
21
  sp_get_template( 'event-fixtures-results.php', array( 'team' => $id ) );
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.6.5
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
16
  if ( 'calendar' === $format )
17
  sp_get_template( 'event-calendar.php', array( 'team' => $id ) );
18
  elseif ( 'list' === $format )
19
+ sp_get_template( 'event-list.php', array(
20
+ 'team' => $id,
21
+ 'league' => apply_filters( 'sp_team_events_league', 0 ),
22
+ 'season' => apply_filters( 'sp_team_events_season', 0 ),
23
+ 'title_format' => 'homeaway',
24
+ 'time_format' => 'separate',
25
+ 'columns' => array( 'event', 'time', 'results' ),
26
+ 'order' => 'DESC',
27
+ ) );
28
  else
29
  sp_get_template( 'event-fixtures-results.php', array( 'team' => $id ) );