SportsPress – Sports Club & League Manager - Version 2.6.11

Version Description

  • Tweak - Apply reverse teams setting to event blocks.
  • Tweak - Add zero before days in countdown when there are less than 10 days to go.
  • Fix - Venue address not setting correctly.
  • Fix - RTL language support for first column in tables.
  • Fix - PHP warnings for various static functions.
  • Fix - Custom post types displaying blank screen in admin when Gutenberg is active.
Download this release

Release Info

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

Code changes from version 2.6.10 to 2.6.11

assets/css/admin.css CHANGED
@@ -1026,6 +1026,7 @@ table.sp-status-table td mark.yes {
1026
  display: inline;
1027
  }
1028
  .about-sportspress-wrap .sp-welcome-logo img {
 
1029
  border: none;
1030
  }
1031
  .about-sportspress-wrap .sp-about-text {
1026
  display: inline;
1027
  }
1028
  .about-sportspress-wrap .sp-welcome-logo img {
1029
+ width: auto;
1030
  border: none;
1031
  }
1032
  .about-sportspress-wrap .sp-about-text {
assets/css/sportspress-style-ltr.css CHANGED
@@ -26,4 +26,8 @@
26
 
27
  .sp-template-event-performance-icons .sp-performance-icons {
28
  text-align: right !important;
29
- }
 
 
 
 
26
 
27
  .sp-template-event-performance-icons .sp-performance-icons {
28
  text-align: right !important;
29
+ }
30
+
31
+ .sp-data-table .data-name {
32
+ text-align: left !important;
33
+ }
assets/css/sportspress-style-rtl.css CHANGED
@@ -26,4 +26,8 @@
26
 
27
  .sp-template-event-performance-icons .sp-performance-icons {
28
  text-align: left !important;
29
- }
 
 
 
 
26
 
27
  .sp-template-event-performance-icons .sp-performance-icons {
28
  text-align: left !important;
29
+ }
30
+
31
+ .sp-data-table .data-name {
32
+ text-align: right !important;
33
+ }
assets/css/sportspress-style.css CHANGED
@@ -169,10 +169,6 @@
169
  color: inherit !important;
170
  }
171
 
172
- .sp-data-table .data-name {
173
- text-align: left !important;
174
- }
175
-
176
  .sp-data-table .sp-highlight,
177
  .sp-data-table .highlighted td {
178
  font-weight: 500 !important;
169
  color: inherit !important;
170
  }
171
 
 
 
 
 
172
  .sp-data-table .sp-highlight,
173
  .sp-data-table .highlighted td {
174
  font-weight: 500 !important;
assets/js/admin/locationpicker.js CHANGED
@@ -10,6 +10,7 @@ jQuery(document).ready(function($){
10
  longitudeInput: $(".sp-longitude"),
11
  locationNameInput: $(".sp-address")
12
  },
 
13
  enableAutocomplete: true
14
  });
15
  });
10
  longitudeInput: $(".sp-longitude"),
11
  locationNameInput: $(".sp-address")
12
  },
13
+ addressFormat: null,
14
  enableAutocomplete: true
15
  });
16
  });
assets/js/jquery.countdown.min.js DELETED
@@ -1,22 +0,0 @@
1
- /*!
2
- * The Final Countdown for jQuery v2.2.0 (http://hilios.github.io/jQuery.countdown/)
3
- * Copyright (c) 2016 Edson Hilios
4
- *
5
- * Permission is hereby granted, free of charge, to any person obtaining a copy of
6
- * this software and associated documentation files (the "Software"), to deal in
7
- * the Software without restriction, including without limitation the rights to
8
- * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
- * the Software, and to permit persons to whom the Software is furnished to do so,
10
- * subject to the following conditions:
11
- *
12
- * The above copyright notice and this permission notice shall be included in all
13
- * copies or substantial portions of the Software.
14
- *
15
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
- * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
- * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
- * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
- */
22
- !function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){"use strict";function b(a){if(a instanceof Date)return a;if(String(a).match(g))return String(a).match(/^[0-9]*$/)&&(a=Number(a)),String(a).match(/\-/)&&(a=String(a).replace(/\-/g,"/")),new Date(a);throw new Error("Couldn't cast `"+a+"` to a date object.")}function c(a){var b=a.toString().replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");return new RegExp(b)}function d(a){return function(b){var d=b.match(/%(-|!)?[A-Z]{1}(:[^;]+;)?/gi);if(d)for(var f=0,g=d.length;f<g;++f){var h=d[f].match(/%(-|!)?([a-zA-Z]{1})(:[^;]+;)?/),j=c(h[0]),k=h[1]||"",l=h[3]||"",m=null;h=h[2],i.hasOwnProperty(h)&&(m=i[h],m=Number(a[m])),null!==m&&("!"===k&&(m=e(l,m)),""===k&&m<10&&(m="0"+m.toString()),b=b.replace(j,m.toString()))}return b=b.replace(/%%/,"%")}}function e(a,b){var c="s",d="";return a&&(a=a.replace(/(:|;|\s)/gi,"").split(/\,/),1===a.length?c=a[0]:(d=a[0],c=a[1])),Math.abs(b)>1?c:d}var f=[],g=[],h={precision:100,elapse:!1,defer:!1};g.push(/^[0-9]*$/.source),g.push(/([0-9]{1,2}\/){2}[0-9]{4}( [0-9]{1,2}(:[0-9]{2}){2})?/.source),g.push(/[0-9]{4}([\/\-][0-9]{1,2}){2}( [0-9]{1,2}(:[0-9]{2}){2})?/.source),g=new RegExp(g.join("|"));var i={Y:"years",m:"months",n:"daysToMonth",d:"daysToWeek",w:"weeks",W:"weeksToMonth",H:"hours",M:"minutes",S:"seconds",D:"totalDays",I:"totalHours",N:"totalMinutes",T:"totalSeconds"},j=function(b,c,d){this.el=b,this.$el=a(b),this.interval=null,this.offset={},this.options=a.extend({},h),this.firstTick=!0,this.instanceNumber=f.length,f.push(this),this.$el.data("countdown-instance",this.instanceNumber),d&&("function"==typeof d?(this.$el.on("update.countdown",d),this.$el.on("stoped.countdown",d),this.$el.on("finish.countdown",d)):this.options=a.extend({},h,d)),this.setFinalDate(c),this.options.defer===!1&&this.start()};a.extend(j.prototype,{start:function(){null!==this.interval&&clearInterval(this.interval);var a=this;this.update(),this.interval=setInterval(function(){a.update.call(a)},this.options.precision)},stop:function(){clearInterval(this.interval),this.interval=null,this.dispatchEvent("stoped")},toggle:function(){this.interval?this.stop():this.start()},pause:function(){this.stop()},resume:function(){this.start()},remove:function(){this.stop.call(this),f[this.instanceNumber]=null,delete this.$el.data().countdownInstance},setFinalDate:function(a){this.finalDate=b(a)},update:function(){if(0===this.$el.closest("html").length)return void this.remove();var a,b=new Date;return a=this.finalDate.getTime()-b.getTime(),a=Math.ceil(a/1e3),a=!this.options.elapse&&a<0?0:Math.abs(a),this.totalSecsLeft===a||this.firstTick?void(this.firstTick=!1):(this.totalSecsLeft=a,this.elapsed=b>=this.finalDate,this.offset={seconds:this.totalSecsLeft%60,minutes:Math.floor(this.totalSecsLeft/60)%60,hours:Math.floor(this.totalSecsLeft/60/60)%24,days:Math.floor(this.totalSecsLeft/60/60/24)%7,daysToWeek:Math.floor(this.totalSecsLeft/60/60/24)%7,daysToMonth:Math.floor(this.totalSecsLeft/60/60/24%30.4368),weeks:Math.floor(this.totalSecsLeft/60/60/24/7),weeksToMonth:Math.floor(this.totalSecsLeft/60/60/24/7)%4,months:Math.floor(this.totalSecsLeft/60/60/24/30.4368),years:Math.abs(this.finalDate.getFullYear()-b.getFullYear()),totalDays:Math.floor(this.totalSecsLeft/60/60/24),totalHours:Math.floor(this.totalSecsLeft/60/60),totalMinutes:Math.floor(this.totalSecsLeft/60),totalSeconds:this.totalSecsLeft},void(this.options.elapse||0!==this.totalSecsLeft?this.dispatchEvent("update"):(this.stop(),this.dispatchEvent("finish"))))},dispatchEvent:function(b){var c=a.Event(b+".countdown");c.finalDate=this.finalDate,c.elapsed=this.elapsed,c.offset=a.extend({},this.offset),c.strftime=d(this.offset),this.$el.trigger(c)}}),a.fn.countdown=function(){var b=Array.prototype.slice.call(arguments,0);return this.each(function(){var c=a(this).data("countdown-instance");if(void 0!==c){var d=f[c],e=b[0];j.prototype.hasOwnProperty(e)?d[e].apply(d,b.slice(1)):null===String(e).match(/^[$A-Z_][0-9A-Z_$]*$/i)?(d.setFinalDate.call(d,e),d.start()):a.error("Method %s does not exist on jQuery.countdown".replace(/\%s/gi,e))}else new j(this,b[0],b[1])})}});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/sportspress.js CHANGED
@@ -42,7 +42,7 @@ function sp_viewport() {
42
  var seconds = Math.floor((distance % (1000 * 60)) / 1000);
43
 
44
  // Output the result
45
- $this.html("<span>"+('0' + days).slice(-3)+" <small>" + localized_strings.days + "</small></span> "
46
  + "<span>"+('0' + hours).slice(-2)+" <small>" + localized_strings.hrs + "</small></span> "
47
  + "<span>"+('0' + minutes).slice(-2)+" <small>" + localized_strings.mins + "</small></span> "
48
  + "<span>"+('0' + seconds).slice(-2)+" <small>" + localized_strings.secs + "</small></span>" );
42
  var seconds = Math.floor((distance % (1000 * 60)) / 1000);
43
 
44
  // Output the result
45
+ $this.html("<span>"+(days < 10 ? '0' + days : days)+" <small>" + localized_strings.days + "</small></span> "
46
  + "<span>"+('0' + hours).slice(-2)+" <small>" + localized_strings.hrs + "</small></span> "
47
  + "<span>"+('0' + minutes).slice(-2)+" <small>" + localized_strings.mins + "</small></span> "
48
  + "<span>"+('0' + seconds).slice(-2)+" <small>" + localized_strings.secs + "</small></span>" );
includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-columns.php CHANGED
@@ -5,7 +5,7 @@
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
- * @version 2.5
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -28,6 +28,8 @@ class SP_Meta_Box_Calendar_Columns {
28
  }
29
 
30
  $columns = array();
 
 
31
 
32
  if ( 'teams' === $title_format ) {
33
  $columns[ 'event' ] = __( 'Home', 'sportspress' ) . ' | ' . __( 'Away', 'sportspress' );
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Meta_Boxes
8
+ * @version 2.6.11
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
28
  }
29
 
30
  $columns = array();
31
+
32
+ $columns['date'] = __( 'Date', 'sportspress' );
33
 
34
  if ( 'teams' === $title_format ) {
35
  $columns[ 'event' ] = __( 'Home', 'sportspress' ) . ' | ' . __( 'Away', 'sportspress' );
includes/class-sp-ajax.php CHANGED
@@ -8,7 +8,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
8
  * AJAX Event Handler
9
  *
10
  * @class SP_AJAX
11
- * @version 2.6.9
12
  * @package SportsPress/Classes
13
  * @category Class
14
  * @author ThemeBoy
@@ -621,6 +621,7 @@ class SP_AJAX {
621
  <?php _e( 'Columns:', 'sportspress' ); ?><br>
622
  <?php
623
  $the_columns = array(
 
624
  'event' => __( 'Event', 'sportspress' ),
625
  'teams' => __( 'Teams', 'sportspress' ),
626
  'time' => __( 'Time', 'sportspress' ),
8
  * AJAX Event Handler
9
  *
10
  * @class SP_AJAX
11
+ * @version 2.6.11
12
  * @package SportsPress/Classes
13
  * @category Class
14
  * @author ThemeBoy
621
  <?php _e( 'Columns:', 'sportspress' ); ?><br>
622
  <?php
623
  $the_columns = array(
624
+ 'date' => __( 'Date', 'sportspress' ),
625
  'event' => __( 'Event', 'sportspress' ),
626
  'teams' => __( 'Teams', 'sportspress' ),
627
  'time' => __( 'Time', 'sportspress' ),
includes/class-sp-calendar.php CHANGED
@@ -8,7 +8,7 @@
8
  * https://wordpress.org/support/topic/timezone-issues-with-schedule-calendar-list/
9
  *
10
  * @class SP_Calendar
11
- * @version 2.6.9
12
  * @package SportsPress/Classes
13
  * @category Class
14
  * @author ThemeBoy
@@ -147,6 +147,8 @@ class SP_Calendar extends SP_Secondary_Post {
147
  $lastday = $weekday[6];
148
  }
149
 
 
 
150
  $args = array(
151
  'post_type' => 'sp_event',
152
  'posts_per_page' => $this->number,
@@ -165,7 +167,7 @@ class SP_Calendar extends SP_Secondary_Post {
165
  switch ( $this->date ):
166
  case '-day':
167
  $date = new DateTime( date_i18n('Y-m-d') );
168
- $date->modify( '-1 day' );
169
  $args['year'] = $date->format('Y');
170
  $args['day'] = $date->format('j');
171
  $args['monthnum'] = $date->format('n');
@@ -184,15 +186,12 @@ class SP_Calendar extends SP_Secondary_Post {
184
  break;
185
  case '-w':
186
  if ( $start_of_week != '1' ) { //If start of week is not Monday
187
- if ( date('w') == $start_of_week ) { //If today is start of Week
188
- $after = date_i18n('Y-m-d', strtotime("$firstday last week"));
189
- $before = date_i18n('Y-m-d', strtotime("$lastday this week")).' 23:59:59';
190
- }elseif ( date('w') < $start_of_week ){
191
- $after = date_i18n('Y-m-d', strtotime("$firstday -2 week"));
192
- $before = date_i18n('Y-m-d', strtotime("$lastday last week")).' 23:59:59';
193
  }else{
194
- $after = date_i18n('Y-m-d', strtotime("$firstday last week"));
195
- $before = date_i18n('Y-m-d', strtotime("$lastday this week")).' 23:59:59';
196
  }
197
  $args['date_query'] = array(
198
  array(
@@ -210,15 +209,15 @@ class SP_Calendar extends SP_Secondary_Post {
210
  break;
211
  case 'w':
212
  if ( $start_of_week != '1' ) { //If start of week is not Monday
213
- if ( date('w') == $start_of_week ) { //If today is start of Week
214
  $after = date_i18n('Y-m-d');
215
- $before = date_i18n('Y-m-d', strtotime("$lastday next week")).' 23:59:59';
216
- }elseif ( date('w') < $start_of_week ){
217
- $after = date_i18n('Y-m-d', strtotime("$firstday last week"));
218
- $before = date_i18n('Y-m-d', strtotime("$lastday this week")).' 23:59:59';
219
  }else{
220
- $after = date_i18n('Y-m-d', strtotime("$firstday this week"));
221
- $before = date_i18n('Y-m-d', strtotime("$lastday next week")).' 23:59:59';
222
  }
223
  $args['date_query'] = array(
224
  array(
@@ -234,15 +233,12 @@ class SP_Calendar extends SP_Secondary_Post {
234
  break;
235
  case '+w':
236
  if ( $start_of_week != '1' ) { //If start of week is not Monday
237
- if ( date('w') == $start_of_week ) { //If today is start of Week
238
- $after = date_i18n('Y-m-d', strtotime("$firstday next week"));
239
- $before = date_i18n('Y-m-d', strtotime("$lastday +1 week")).' 23:59:59';
240
- }elseif ( date('w') < $start_of_week ){
241
- $after = date_i18n('Y-m-d', strtotime("$firstday this week"));
242
- $before = date_i18n('Y-m-d', strtotime("$lastday next week")).' 23:59:59';
243
- }else{
244
- $after = date_i18n('Y-m-d', strtotime("$firstday next week"));
245
- $before = date_i18n('Y-m-d', strtotime("$lastday +1 week")).' 23:59:59';
246
  }
247
  $args['date_query'] = array(
248
  array(
@@ -430,7 +426,7 @@ class SP_Calendar extends SP_Secondary_Post {
430
  if ( $this->teams_past ){
431
  $events_past = array();
432
  foreach ( $events as $single_event ) {
433
- if ( get_post_meta( $single_event->ID,'sp_team' ) === $this->teams_past ){
434
  $events_past[] = $single_event;
435
  }
436
  }
8
  * https://wordpress.org/support/topic/timezone-issues-with-schedule-calendar-list/
9
  *
10
  * @class SP_Calendar
11
+ * @version 2.6.11
12
  * @package SportsPress/Classes
13
  * @category Class
14
  * @author ThemeBoy
147
  $lastday = $weekday[6];
148
  }
149
 
150
+ $today = date('l');
151
+
152
  $args = array(
153
  'post_type' => 'sp_event',
154
  'posts_per_page' => $this->number,
167
  switch ( $this->date ):
168
  case '-day':
169
  $date = new DateTime( date_i18n('Y-m-d') );
170
+ $date->modify( '-1 day' );
171
  $args['year'] = $date->format('Y');
172
  $args['day'] = $date->format('j');
173
  $args['monthnum'] = $date->format('n');
186
  break;
187
  case '-w':
188
  if ( $start_of_week != '1' ) { //If start of week is not Monday
189
+ if ( $today == $firstday ) { //If today is start of Week
190
+ $after = date_i18n('Y-m-d', strtotime("last $firstday"));
191
+ $before = date_i18n('Y-m-d', strtotime("last $lastday")).' 23:59:59';
 
 
 
192
  }else{
193
+ $after = date_i18n('Y-m-d', strtotime("-2 $firstday"));
194
+ $before = date_i18n('Y-m-d', strtotime("last $lastday")).' 23:59:59';
195
  }
196
  $args['date_query'] = array(
197
  array(
209
  break;
210
  case 'w':
211
  if ( $start_of_week != '1' ) { //If start of week is not Monday
212
+ if ( $today == $firstday ) { //If today is start of Week
213
  $after = date_i18n('Y-m-d');
214
+ $before = date_i18n('Y-m-d', strtotime("next $lastday")).' 23:59:59';
215
+ }elseif ( $today == $lastday ) { //If today is the end of Week
216
+ $after = date_i18n('Y-m-d', strtotime("last $firstday"));
217
+ $before = date_i18n('Y-m-d').' 23:59:59';
218
  }else{
219
+ $after = date_i18n('Y-m-d', strtotime("last $firstday"));
220
+ $before = date_i18n('Y-m-d', strtotime("next $lastday")).' 23:59:59';
221
  }
222
  $args['date_query'] = array(
223
  array(
233
  break;
234
  case '+w':
235
  if ( $start_of_week != '1' ) { //If start of week is not Monday
236
+ if ( $today == $lastday ) { //If today is the end of Week
237
+ $after = date_i18n('Y-m-d', strtotime("next $firstday"));
238
+ $before = date_i18n('Y-m-d', strtotime("next $lastday")).' 23:59:59';
239
+ }else{
240
+ $after = date_i18n('Y-m-d', strtotime("next $firstday"));
241
+ $before = date_i18n('Y-m-d', strtotime("+2 $lastday")).' 23:59:59';
 
 
 
242
  }
243
  $args['date_query'] = array(
244
  array(
426
  if ( $this->teams_past ){
427
  $events_past = array();
428
  foreach ( $events as $single_event ) {
429
+ if ( sort( get_post_meta( $single_event->ID, 'sp_team' ) ) === sort( $this->teams_past ) ) {
430
  $events_past[] = $single_event;
431
  }
432
  }
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
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
@@ -49,10 +49,6 @@ class SP_Event extends SP_Custom_Post{
49
 
50
  // Get results for all teams
51
  $data = sp_array_combine( $teams, $results, true );
52
-
53
- if ( 'yes' === get_option( 'sportspress_event_reverse_teams', 'no' ) ) {
54
- $data = array_reverse( $data, true );
55
- }
56
 
57
  if ( $admin ):
58
  return array( $columns, $usecolumns, $data );
@@ -188,7 +184,7 @@ class SP_Event extends SP_Custom_Post{
188
  if ( ! is_array( $players ) ) continue;
189
 
190
  foreach ( $players as $player => $player_performance ):
191
- if ( ! is_array( $player_performance ) ) continue;
192
 
193
  // Prepare existing values for equation calculation
194
  $vars = $player_performance;
5
  * The SportsPress event class handles individual event data.
6
  *
7
  * @class SP_Event
8
+ * @version 2.6.11
9
  * @package SportsPress/Classes
10
  * @category Class
11
  * @author ThemeBoy
49
 
50
  // Get results for all teams
51
  $data = sp_array_combine( $teams, $results, true );
 
 
 
 
52
 
53
  if ( $admin ):
54
  return array( $columns, $usecolumns, $data );
184
  if ( ! is_array( $players ) ) continue;
185
 
186
  foreach ( $players as $player => $player_performance ):
187
+ if ( ! is_array( $player_performance ) || ! $player ) continue;
188
 
189
  // Prepare existing values for equation calculation
190
  $vars = $player_performance;
includes/class-sp-post-types.php CHANGED
@@ -9,7 +9,7 @@ if ( ! defined( 'ABSPATH' ) ) {
9
  * Registers post types and taxonomies
10
  *
11
  * @class SP_Post_types
12
- * @version 2.6.8
13
  * @package SportsPress/Classes
14
  * @category Class
15
  * @author ThemeBoy
@@ -223,6 +223,8 @@ class SP_Post_types {
223
  public static function register_post_types() {
224
  do_action( 'sportspress_register_post_type' );
225
 
 
 
226
  register_post_type( 'sp_result',
227
  apply_filters( 'sportspress_register_post_type_result',
228
  array(
@@ -436,7 +438,7 @@ class SP_Post_types {
436
  'has_archive' => false,
437
  'show_in_nav_menus' => true,
438
  'menu_icon' => 'dashicons-calendar',
439
- 'show_in_rest' => true,
440
  'rest_controller_class' => 'SP_REST_Posts_Controller',
441
  'rest_base' => 'events',
442
  );
@@ -477,7 +479,7 @@ class SP_Post_types {
477
  'has_archive' => false,
478
  'show_in_nav_menus' => true,
479
  'menu_icon' => 'dashicons-shield-alt',
480
- 'show_in_rest' => true,
481
  'rest_controller_class' => 'SP_REST_Posts_Controller',
482
  'rest_base' => 'teams',
483
  )
@@ -514,7 +516,7 @@ class SP_Post_types {
514
  'has_archive' => false,
515
  'show_in_nav_menus' => true,
516
  'menu_icon' => 'dashicons-groups',
517
- 'show_in_rest' => true,
518
  'rest_controller_class' => 'SP_REST_Posts_Controller',
519
  'rest_base' => 'players',
520
  )
@@ -551,7 +553,7 @@ class SP_Post_types {
551
  'has_archive' => false,
552
  'show_in_nav_menus' => true,
553
  'menu_icon' => 'dashicons-businessman',
554
- 'show_in_rest' => true,
555
  'rest_controller_class' => 'SP_REST_Posts_Controller',
556
  'rest_base' => 'staff',
557
  )
9
  * Registers post types and taxonomies
10
  *
11
  * @class SP_Post_types
12
+ * @version 2.6.11
13
  * @package SportsPress/Classes
14
  * @category Class
15
  * @author ThemeBoy
223
  public static function register_post_types() {
224
  do_action( 'sportspress_register_post_type' );
225
 
226
+ $show_in_rest = ! function_exists( 'register_block_type' );
227
+
228
  register_post_type( 'sp_result',
229
  apply_filters( 'sportspress_register_post_type_result',
230
  array(
438
  'has_archive' => false,
439
  'show_in_nav_menus' => true,
440
  'menu_icon' => 'dashicons-calendar',
441
+ 'show_in_rest' => $show_in_rest,
442
  'rest_controller_class' => 'SP_REST_Posts_Controller',
443
  'rest_base' => 'events',
444
  );
479
  'has_archive' => false,
480
  'show_in_nav_menus' => true,
481
  'menu_icon' => 'dashicons-shield-alt',
482
+ 'show_in_rest' => $show_in_rest,
483
  'rest_controller_class' => 'SP_REST_Posts_Controller',
484
  'rest_base' => 'teams',
485
  )
516
  'has_archive' => false,
517
  'show_in_nav_menus' => true,
518
  'menu_icon' => 'dashicons-groups',
519
+ 'show_in_rest' => $show_in_rest,
520
  'rest_controller_class' => 'SP_REST_Posts_Controller',
521
  'rest_base' => 'players',
522
  )
553
  'has_archive' => false,
554
  'show_in_nav_menus' => true,
555
  'menu_icon' => 'dashicons-businessman',
556
+ 'show_in_rest' => $show_in_rest,
557
  'rest_controller_class' => 'SP_REST_Posts_Controller',
558
  'rest_base' => 'staff',
559
  )
includes/widgets/class-sp-widget-countdown.php CHANGED
@@ -53,7 +53,7 @@ class SP_Widget_Countdown extends WP_Widget {
53
  }
54
 
55
  function form( $instance ) {
56
- $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'calendar' => '', 'team' => '', 'id' => '', 'caption' => '', 'show_venue' => false, 'show_league' => false ) );
57
  $title = strip_tags($instance['title']);
58
  $caption = strip_tags($instance['caption']);
59
  $calendar = intval($instance['calendar']);
53
  }
54
 
55
  function form( $instance ) {
56
+ $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'calendar' => '', 'team' => '', 'id' => '', 'caption' => '', 'show_venue' => false, 'show_league' => false, 'show_date' => false ) );
57
  $title = strip_tags($instance['title']);
58
  $caption = strip_tags($instance['caption']);
59
  $calendar = intval($instance['calendar']);
modules/sportspress-calendars.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://themeboy.com/
5
  Description: Add event calendars to SportsPress.
6
  Author: ThemeBoy
7
  Author URI: http://themeboy.com/
8
- Version: 2.6.8
9
  */
10
 
11
  // Exit if accessed directly
@@ -17,7 +17,7 @@ if ( ! class_exists( 'SportsPress_Calendars' ) ) :
17
  * Main SportsPress Calendars Class
18
  *
19
  * @class SportsPress_Calendars
20
- * @version 2.6.8
21
  */
22
  class SportsPress_Calendars {
23
 
@@ -51,7 +51,7 @@ class SportsPress_Calendars {
51
  */
52
  private function define_constants() {
53
  if ( !defined( 'SP_CALENDARS_VERSION' ) )
54
- define( 'SP_CALENDARS_VERSION', '2.6.8' );
55
 
56
  if ( !defined( 'SP_CALENDARS_URL' ) )
57
  define( 'SP_CALENDARS_URL', plugin_dir_url( __FILE__ ) );
@@ -91,7 +91,7 @@ class SportsPress_Calendars {
91
  'show_in_nav_menus' => true,
92
  'show_in_menu' => 'edit.php?post_type=sp_event',
93
  'show_in_admin_bar' => true,
94
- 'show_in_rest' => true,
95
  'rest_controller_class' => 'SP_REST_Posts_Controller',
96
  'rest_base' => 'calendars',
97
  )
5
  Description: Add event calendars to SportsPress.
6
  Author: ThemeBoy
7
  Author URI: http://themeboy.com/
8
+ Version: 2.6.11
9
  */
10
 
11
  // Exit if accessed directly
17
  * Main SportsPress Calendars Class
18
  *
19
  * @class SportsPress_Calendars
20
+ * @version 2.6.11
21
  */
22
  class SportsPress_Calendars {
23
 
51
  */
52
  private function define_constants() {
53
  if ( !defined( 'SP_CALENDARS_VERSION' ) )
54
+ define( 'SP_CALENDARS_VERSION', '2.6.11' );
55
 
56
  if ( !defined( 'SP_CALENDARS_URL' ) )
57
  define( 'SP_CALENDARS_URL', plugin_dir_url( __FILE__ ) );
91
  'show_in_nav_menus' => true,
92
  'show_in_menu' => 'edit.php?post_type=sp_event',
93
  'show_in_admin_bar' => true,
94
+ 'show_in_rest' => ! function_exists( 'register_block_type' ),
95
  'rest_controller_class' => 'SP_REST_Posts_Controller',
96
  'rest_base' => 'calendars',
97
  )
modules/sportspress-league-tables.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://themeboy.com/
5
  Description: Add league tables to SportsPress.
6
  Author: ThemeBoy
7
  Author URI: http://themeboy.com/
8
- Version: 2.4
9
  */
10
 
11
  // Exit if accessed directly
@@ -17,7 +17,7 @@ if ( ! class_exists( 'SportsPress_League_Tables' ) ) :
17
  * Main SportsPress League Tables Class
18
  *
19
  * @class SportsPress_League_Tables
20
- * @version 2.4
21
  */
22
  class SportsPress_League_Tables {
23
 
@@ -48,7 +48,7 @@ class SportsPress_League_Tables {
48
  */
49
  private function define_constants() {
50
  if ( !defined( 'SP_LEAGUE_TABLES_VERSION' ) )
51
- define( 'SP_LEAGUE_TABLES_VERSION', '2.4' );
52
 
53
  if ( !defined( 'SP_LEAGUE_TABLES_URL' ) )
54
  define( 'SP_LEAGUE_TABLES_URL', plugin_dir_url( __FILE__ ) );
@@ -88,7 +88,7 @@ class SportsPress_League_Tables {
88
  'show_in_nav_menus' => true,
89
  'show_in_menu' => 'edit.php?post_type=sp_team',
90
  'show_in_admin_bar' => true,
91
- 'show_in_rest' => true,
92
  'rest_controller_class' => 'SP_REST_Posts_Controller',
93
  'rest_base' => 'tables',
94
  )
5
  Description: Add league tables to SportsPress.
6
  Author: ThemeBoy
7
  Author URI: http://themeboy.com/
8
+ Version: 2.6.11
9
  */
10
 
11
  // Exit if accessed directly
17
  * Main SportsPress League Tables Class
18
  *
19
  * @class SportsPress_League_Tables
20
+ * @version 2.6.11
21
  */
22
  class SportsPress_League_Tables {
23
 
48
  */
49
  private function define_constants() {
50
  if ( !defined( 'SP_LEAGUE_TABLES_VERSION' ) )
51
+ define( 'SP_LEAGUE_TABLES_VERSION', '2.6.11' );
52
 
53
  if ( !defined( 'SP_LEAGUE_TABLES_URL' ) )
54
  define( 'SP_LEAGUE_TABLES_URL', plugin_dir_url( __FILE__ ) );
88
  'show_in_nav_menus' => true,
89
  'show_in_menu' => 'edit.php?post_type=sp_team',
90
  'show_in_admin_bar' => true,
91
+ 'show_in_rest' => ! function_exists( 'register_block_type' ),
92
  'rest_controller_class' => 'SP_REST_Posts_Controller',
93
  'rest_base' => 'tables',
94
  )
modules/sportspress-next-team-preset.php CHANGED
@@ -38,6 +38,7 @@ if ( ! class_exists( 'SportsPress_Next_Team_Preset' ) ) :
38
  add_filter( 'sportspress_equation_options', array( $this, 'add_options' ) );
39
  add_filter( 'sportspress_equation_presets', array( $this, 'presets' ) );
40
  add_filter( 'sportspress_equation_solve_for_presets', array( $this, 'solve' ), 10, 3 );
 
41
 
42
  }
43
 
@@ -96,6 +97,26 @@ if ( ! class_exists( 'SportsPress_Next_Team_Preset' ) ) :
96
  ),
97
  'order' => 'ASC',
98
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
  $events = get_posts( $args );
100
 
101
  if ( $events ) {
@@ -130,6 +151,22 @@ if ( ! class_exists( 'SportsPress_Next_Team_Preset' ) ) :
130
  return $input;
131
  }
132
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
133
  }
134
 
135
  endif;
38
  add_filter( 'sportspress_equation_options', array( $this, 'add_options' ) );
39
  add_filter( 'sportspress_equation_presets', array( $this, 'presets' ) );
40
  add_filter( 'sportspress_equation_solve_for_presets', array( $this, 'solve' ), 10, 3 );
41
+ add_filter( 'sportspress_table_options', array( $this, 'add_settings' ) );
42
 
43
  }
44
 
97
  ),
98
  'order' => 'ASC',
99
  );
100
+
101
+ if ( get_option( 'sportspress_table_next_team_filter_league', 'no' ) === 'yes' ) {
102
+ $leagues = get_the_terms( get_the_ID(), 'sp_league' );
103
+ if ( ! isset( $league_ids ) ) $league_ids = array();
104
+ if ( empty( $league_ids ) && $leagues ):
105
+ foreach( $leagues as $league ):
106
+ $league_ids[] = $league->term_id;
107
+ endforeach;
108
+ endif;
109
+ $league_ids = sp_add_auto_term( $league_ids, get_the_ID(), 'sp_league' );
110
+
111
+ if ( isset( $league_ids ) ) {
112
+ $args['tax_query'][] = array(
113
+ 'taxonomy' => 'sp_league',
114
+ 'field' => 'term_id',
115
+ 'terms' => $league_ids
116
+ );
117
+ }
118
+ }
119
+
120
  $events = get_posts( $args );
121
 
122
  if ( $events ) {
151
  return $input;
152
  }
153
  }
154
+
155
+ /**
156
+ * Add settings.
157
+ *
158
+ * @return array
159
+ */
160
+ public function add_settings( $settings ) {
161
+ $settings[] = array(
162
+ 'title' => __( 'Next Team', 'sportspress' ),
163
+ 'desc' => __( 'Filter by League', 'sportspress' ),
164
+ 'id' => 'sportspress_table_next_team_filter_league',
165
+ 'default' => 'no',
166
+ 'type' => 'checkbox',
167
+ );
168
+ return $settings;
169
+ }
170
  }
171
 
172
  endif;
modules/sportspress-officials.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://themeboy.com/
5
  Description: Add officials to SportsPress.
6
  Author: ThemeBoy
7
  Author URI: http://themeboy.com/
8
- Version: 2.6
9
  */
10
 
11
  // Exit if accessed directly
@@ -17,7 +17,7 @@ if ( ! class_exists( 'SportsPress_Officials' ) ) :
17
  * Main SportsPress Officials Class
18
  *
19
  * @class SportsPress_Officials
20
- * @version 2.6
21
  */
22
  class SportsPress_Officials {
23
 
@@ -66,7 +66,7 @@ class SportsPress_Officials {
66
  */
67
  private function define_constants() {
68
  if ( !defined( 'SP_OFFICIALS_VERSION' ) )
69
- define( 'SP_OFFICIALS_VERSION', '2.6' );
70
 
71
  if ( !defined( 'SP_OFFICIALS_URL' ) )
72
  define( 'SP_OFFICIALS_URL', plugin_dir_url( __FILE__ ) );
@@ -154,7 +154,7 @@ class SportsPress_Officials {
154
  'has_archive' => false,
155
  'show_in_nav_menus' => true,
156
  'menu_icon' => 'dashicons-flag',
157
- 'show_in_rest' => true,
158
  'rest_controller_class' => 'SP_REST_Posts_Controller',
159
  'rest_base' => 'officials',
160
  )
5
  Description: Add officials to SportsPress.
6
  Author: ThemeBoy
7
  Author URI: http://themeboy.com/
8
+ Version: 2.6.11
9
  */
10
 
11
  // Exit if accessed directly
17
  * Main SportsPress Officials Class
18
  *
19
  * @class SportsPress_Officials
20
+ * @version 2.6.11
21
  */
22
  class SportsPress_Officials {
23
 
66
  */
67
  private function define_constants() {
68
  if ( !defined( 'SP_OFFICIALS_VERSION' ) )
69
+ define( 'SP_OFFICIALS_VERSION', '2.6.11' );
70
 
71
  if ( !defined( 'SP_OFFICIALS_URL' ) )
72
  define( 'SP_OFFICIALS_URL', plugin_dir_url( __FILE__ ) );
154
  'has_archive' => false,
155
  'show_in_nav_menus' => true,
156
  'menu_icon' => 'dashicons-flag',
157
+ 'show_in_rest' => ! function_exists( 'register_block_type' ),
158
  'rest_controller_class' => 'SP_REST_Posts_Controller',
159
  'rest_base' => 'officials',
160
  )
modules/sportspress-player-lists.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://themeboy.com/
5
  Description: Add player lists to SportsPress.
6
  Author: ThemeBoy
7
  Author URI: http://themeboy.com/
8
- Version: 2.1.4
9
  */
10
 
11
  // Exit if accessed directly
@@ -17,7 +17,7 @@ if ( ! class_exists( 'SportsPress_Player_Lists' ) ) :
17
  * Main SportsPress Player Lists Class
18
  *
19
  * @class SportsPress_Player_Lists
20
- * @version 2.1.4
21
  */
22
  class SportsPress_Player_Lists {
23
 
@@ -48,7 +48,7 @@ class SportsPress_Player_Lists {
48
  */
49
  private function define_constants() {
50
  if ( !defined( 'SP_PLAYER_LISTS_VERSION' ) )
51
- define( 'SP_PLAYER_LISTS_VERSION', '2.1.4' );
52
 
53
  if ( !defined( 'SP_PLAYER_LISTS_URL' ) )
54
  define( 'SP_PLAYER_LISTS_URL', plugin_dir_url( __FILE__ ) );
@@ -88,7 +88,7 @@ class SportsPress_Player_Lists {
88
  'show_in_nav_menus' => true,
89
  'show_in_menu' => 'edit.php?post_type=sp_player',
90
  'show_in_admin_bar' => true,
91
- 'show_in_rest' => true,
92
  'rest_controller_class' => 'SP_REST_Posts_Controller',
93
  'rest_base' => 'lists',
94
  )
5
  Description: Add player lists to SportsPress.
6
  Author: ThemeBoy
7
  Author URI: http://themeboy.com/
8
+ Version: 2.6.11
9
  */
10
 
11
  // Exit if accessed directly
17
  * Main SportsPress Player Lists Class
18
  *
19
  * @class SportsPress_Player_Lists
20
+ * @version 2.6.11
21
  */
22
  class SportsPress_Player_Lists {
23
 
48
  */
49
  private function define_constants() {
50
  if ( !defined( 'SP_PLAYER_LISTS_VERSION' ) )
51
+ define( 'SP_PLAYER_LISTS_VERSION', '2.6.11' );
52
 
53
  if ( !defined( 'SP_PLAYER_LISTS_URL' ) )
54
  define( 'SP_PLAYER_LISTS_URL', plugin_dir_url( __FILE__ ) );
88
  'show_in_nav_menus' => true,
89
  'show_in_menu' => 'edit.php?post_type=sp_player',
90
  'show_in_admin_bar' => true,
91
+ 'show_in_rest' => ! function_exists( 'register_block_type' ),
92
  'rest_controller_class' => 'SP_REST_Posts_Controller',
93
  'rest_base' => 'lists',
94
  )
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: ThemeBoy, brianmiyaji, aylaview, savvasha, nabil_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.10
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -237,6 +237,14 @@ When you upgrade to one of the SportsPress Pro licenses, you can simply activate
237
 
238
  == Changelog ==
239
 
 
 
 
 
 
 
 
 
240
  = 2.6.10 =
241
  * Tweak - Apply reverse teams settings to logos.
242
  * Fix - Statistics doubling in player lists when player is assigned to a team.
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.0
7
+ Stable tag: 2.6.11
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
237
 
238
  == Changelog ==
239
 
240
+ = 2.6.11 =
241
+ * Tweak - Apply reverse teams setting to event blocks.
242
+ * Tweak - Add zero before days in countdown when there are less than 10 days to go.
243
+ * Fix - Venue address not setting correctly.
244
+ * Fix - RTL language support for first column in tables.
245
+ * Fix - PHP warnings for various static functions.
246
+ * Fix - Custom post types displaying blank screen in admin when Gutenberg is active.
247
+
248
  = 2.6.10 =
249
  * Tweak - Apply reverse teams settings to logos.
250
  * Fix - Statistics doubling in player lists when player is assigned to a team.
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.6.10
7
  * Author: ThemeBoy
8
  * Author URI: http://themeboy.com
9
  * Requires at least: 3.8
10
- * Tested up to: 4.9
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.6.10
30
  */
31
  final class SportsPress {
32
 
33
  /**
34
  * @var string
35
  */
36
- public $version = '2.6.10';
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.11
7
  * Author: ThemeBoy
8
  * Author URI: http://themeboy.com
9
  * Requires at least: 3.8
10
+ * Tested up to: 5.0
11
  *
12
  * Text Domain: sportspress
13
  * Domain Path: /languages/
26
  * Main SportsPress Class
27
  *
28
  * @class SportsPress
29
+ * @version 2.6.11
30
  */
31
  final class SportsPress {
32
 
33
  /**
34
  * @var string
35
  */
36
+ public $version = '2.6.11';
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.9
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -107,15 +107,13 @@ if ( $link_events ) $title = '<a href="' . get_post_permalink( $post->ID, false,
107
  </h3>
108
  <?php
109
  if ( isset( $show_date ) && $show_date ):
110
- //if ( isset( $event_date ) ):
111
- ?>
112
- <h5 class="event-date sp-event-date">
113
- <?php
114
- echo get_the_time( get_option( 'date_format', $post ) ).' '.get_the_time( get_option( 'time_format', $post ) ).' (local time)';
115
- ?>
116
- </h5>
117
  <?php
118
- //endif;
 
 
 
119
  endif;
120
 
121
  if ( isset( $show_venue ) && $show_venue ):
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.6.11
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
107
  </h3>
108
  <?php
109
  if ( isset( $show_date ) && $show_date ):
110
+ ?>
111
+ <h5 class="event-date sp-event-date">
 
 
 
 
 
112
  <?php
113
+ echo get_the_time( get_option( 'date_format' ), $post );
114
+ ?>
115
+ </h5>
116
+ <?php
117
  endif;
118
 
119
  if ( isset( $show_venue ) && $show_venue ):
templates/event-blocks.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 2.6.9
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -117,11 +117,17 @@ if ( $title )
117
  if ( isset( $limit ) && $i >= $limit ) continue;
118
 
119
  $permalink = get_post_permalink( $event, false, true );
120
- $results = get_post_meta( $event->ID, 'sp_results', true );
121
 
122
  $teams = array_unique( get_post_meta( $event->ID, 'sp_team' ) );
123
  $teams = array_filter( $teams, 'sp_filter_positive' );
124
  $logos = array();
 
 
 
 
 
 
125
 
126
  if ( $show_team_logo ):
127
  $j = 0;
@@ -163,7 +169,7 @@ if ( $title )
163
  <div class="sp-event-matchday">(<?php echo $matchday; ?>)</div>
164
  <?php endif; endif; ?>
165
  <h5 class="sp-event-results">
166
- <?php echo sp_add_link( '<span class="sp-result">' . implode( '</span> - <span class="sp-result">', apply_filters( 'sportspress_event_blocks_team_result_or_time', sp_get_main_results_or_time( $event ), $event->ID ) ) . '</span>', $permalink, $link_events ); ?>
167
  </h5>
168
  <?php if ( $show_league ): $leagues = get_the_terms( $event, 'sp_league' ); if ( $leagues ): $league = array_shift( $leagues ); ?>
169
  <div class="sp-event-league"><?php echo $league->name; ?></div>
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.6.11
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
117
  if ( isset( $limit ) && $i >= $limit ) continue;
118
 
119
  $permalink = get_post_permalink( $event, false, true );
120
+ $results = sp_get_main_results_or_time( $event );
121
 
122
  $teams = array_unique( get_post_meta( $event->ID, 'sp_team' ) );
123
  $teams = array_filter( $teams, 'sp_filter_positive' );
124
  $logos = array();
125
+ $event_status = get_post_meta( $event->ID, 'sp_status', true );
126
+
127
+ if ( get_option( 'sportspress_event_reverse_teams', 'no' ) === 'yes' ) {
128
+ $teams = array_reverse( $teams , true );
129
+ $results = array_reverse( $results , true );
130
+ }
131
 
132
  if ( $show_team_logo ):
133
  $j = 0;
169
  <div class="sp-event-matchday">(<?php echo $matchday; ?>)</div>
170
  <?php endif; endif; ?>
171
  <h5 class="sp-event-results">
172
+ <?php echo sp_add_link( '<span class="sp-result '.$event_status.'">' . implode( '</span> - <span class="sp-result">', apply_filters( 'sportspress_event_blocks_team_result_or_time', $results, $event->ID ) ) . '</span>', $permalink, $link_events ); ?>
173
  </h5>
174
  <?php if ( $show_league ): $leagues = get_the_terms( $event, 'sp_league' ); if ( $leagues ): $league = array_shift( $leagues ); ?>
175
  <div class="sp-event-league"><?php echo $league->name; ?></div>
templates/event-list.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 2.6.9
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -51,7 +51,7 @@ extract( $defaults, EXTR_SKIP );
51
  $calendar = new SP_Calendar( $id );
52
  if ( $status != 'default' )
53
  $calendar->status = $status;
54
- if ( $format != 'all' )
55
  $calendar->event_format = $format;
56
  if ( $date != 'default' )
57
  $calendar->date = $date;
@@ -113,7 +113,9 @@ $identifier = uniqid( 'eventlist_' );
113
  <thead>
114
  <tr>
115
  <?php
116
- echo '<th class="data-date">' . __( 'Date', 'sportspress' ) . '</th>';
 
 
117
 
118
  switch ( $title_format ) {
119
  case 'homeaway':
@@ -197,6 +199,7 @@ $identifier = uniqid( 'eventlist_' );
197
 
198
  $teams = get_post_meta( $event->ID, 'sp_team' );
199
  $video = get_post_meta( $event->ID, 'sp_video', true );
 
200
 
201
  $main_results = apply_filters( 'sportspress_event_list_main_results', sp_get_main_results( $event ), $event->ID );
202
 
@@ -255,7 +258,9 @@ $identifier = uniqid( 'eventlist_' );
255
 
256
  if ( $link_events ) $date_html = '<a href="' . get_post_permalink( $event->ID, false, true ) . '" itemprop="url">' . $date_html . '</a>';
257
 
258
- echo '<td class="data-date" itemprop="startDate" content="' . mysql2date( 'Y-m-d\TH:iP', $event->post_date ) . '" data-label="'.__( 'Date', 'sportspress' ).'">' . $date_html . '</td>';
 
 
259
 
260
  switch ( $title_format ) {
261
  case 'homeaway':
@@ -265,7 +270,7 @@ $identifier = uniqid( 'eventlist_' );
265
  }
266
 
267
  if ( 'combined' == $time_format && sp_column_active( $usecolumns, 'time' ) ) {
268
- echo '<td class="data-time" data-label="'.__( 'Time/Results', 'sportspress' ).'">';
269
  if ( $link_events ) echo '<a href="' . get_post_permalink( $event->ID, false, true ) . '" itemprop="url">';
270
  if ( ! empty( $main_results ) ):
271
  echo implode( ' - ', $main_results );
@@ -292,7 +297,7 @@ $identifier = uniqid( 'eventlist_' );
292
  }
293
 
294
  if ( in_array( $time_format, array( 'separate', 'time' ) ) && sp_column_active( $usecolumns, 'time' ) ) {
295
- echo '<td class="data-time" data-label="'.__( 'Time', 'sportspress' ).'">';
296
  if ( $link_events ) echo '<a href="' . get_post_permalink( $event->ID, false, true ) . '" itemprop="url">';
297
  echo '<date>&nbsp;' . get_post_time( 'H:i:s', false, $event ) . '</date>' . apply_filters( 'sportspress_event_time', sp_get_time( $event ), $event->ID );
298
  if ( $link_events ) echo '</a>';
@@ -313,7 +318,7 @@ $identifier = uniqid( 'eventlist_' );
313
  switch ( $time_format ) {
314
  case 'separate':
315
  if ( sp_column_active( $usecolumns, 'time' ) ) {
316
- echo '<td class="data-time" data-label="'.__( 'Time', 'sportspress' ).'">';
317
  if ( $link_events ) echo '<a href="' . get_post_permalink( $event->ID, false, true ) . '" itemprop="url">';
318
  echo '<date>&nbsp;' . get_post_time( 'H:i:s', false, $event ) . '</date>' . apply_filters( 'sportspress_event_time', sp_get_time( $event ), $event->ID );
319
  if ( $link_events ) echo '</a>';
@@ -333,7 +338,7 @@ $identifier = uniqid( 'eventlist_' );
333
  break;
334
  case 'time':
335
  if ( sp_column_active( $usecolumns, 'time' ) ) {
336
- echo '<td class="data-time" data-label="'.__( 'Time', 'sportspress' ).'">';
337
  if ( $link_events ) echo '<a href="' . get_post_permalink( $event->ID, false, true ) . '" itemprop="url">';
338
  echo '<date>&nbsp;' . get_post_time( 'H:i:s', false, $event ) . '</date>' . apply_filters( 'sportspress_event_time', sp_get_time( $event ), $event->ID );
339
  if ( $link_events ) echo '</a>';
@@ -355,7 +360,7 @@ $identifier = uniqid( 'eventlist_' );
355
  break;
356
  default:
357
  if ( sp_column_active( $usecolumns, 'time' ) ) {
358
- echo '<td class="data-time" data-label="'.__( 'Time/Results', 'sportspress' ).'">';
359
  if ( $link_events ) echo '<a href="' . get_post_permalink( $event->ID, false, true ) . '" itemprop="url">';
360
  if ( ! empty( $main_results ) ):
361
  echo implode( ' - ', $main_results );
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.6.11
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
51
  $calendar = new SP_Calendar( $id );
52
  if ( $status != 'default' )
53
  $calendar->status = $status;
54
+ if ( $format != 'default' )
55
  $calendar->event_format = $format;
56
  if ( $date != 'default' )
57
  $calendar->date = $date;
113
  <thead>
114
  <tr>
115
  <?php
116
+ if ( sp_column_active( $usecolumns, 'date' ) ) {
117
+ echo '<th class="data-date">' . __( 'Date', 'sportspress' ) . '</th>';
118
+ }
119
 
120
  switch ( $title_format ) {
121
  case 'homeaway':
199
 
200
  $teams = get_post_meta( $event->ID, 'sp_team' );
201
  $video = get_post_meta( $event->ID, 'sp_video', true );
202
+ $status = get_post_meta( $event->ID, 'sp_status', true );
203
 
204
  $main_results = apply_filters( 'sportspress_event_list_main_results', sp_get_main_results( $event ), $event->ID );
205
 
258
 
259
  if ( $link_events ) $date_html = '<a href="' . get_post_permalink( $event->ID, false, true ) . '" itemprop="url">' . $date_html . '</a>';
260
 
261
+ if ( sp_column_active( $usecolumns, 'date' ) ) {
262
+ echo '<td class="data-date" itemprop="startDate" content="' . mysql2date( 'Y-m-d\TH:iP', $event->post_date ) . '" data-label="'.__( 'Date', 'sportspress' ).'">' . $date_html . '</td>';
263
+ }
264
 
265
  switch ( $title_format ) {
266
  case 'homeaway':
270
  }
271
 
272
  if ( 'combined' == $time_format && sp_column_active( $usecolumns, 'time' ) ) {
273
+ echo '<td class="data-time '.$status.'" data-label="'.__( 'Time/Results', 'sportspress' ).'">';
274
  if ( $link_events ) echo '<a href="' . get_post_permalink( $event->ID, false, true ) . '" itemprop="url">';
275
  if ( ! empty( $main_results ) ):
276
  echo implode( ' - ', $main_results );
297
  }
298
 
299
  if ( in_array( $time_format, array( 'separate', 'time' ) ) && sp_column_active( $usecolumns, 'time' ) ) {
300
+ echo '<td class="data-time '.$status.'" data-label="'.__( 'Time', 'sportspress' ).'">';
301
  if ( $link_events ) echo '<a href="' . get_post_permalink( $event->ID, false, true ) . '" itemprop="url">';
302
  echo '<date>&nbsp;' . get_post_time( 'H:i:s', false, $event ) . '</date>' . apply_filters( 'sportspress_event_time', sp_get_time( $event ), $event->ID );
303
  if ( $link_events ) echo '</a>';
318
  switch ( $time_format ) {
319
  case 'separate':
320
  if ( sp_column_active( $usecolumns, 'time' ) ) {
321
+ echo '<td class="data-time '.$status.'" data-label="'.__( 'Time', 'sportspress' ).'">';
322
  if ( $link_events ) echo '<a href="' . get_post_permalink( $event->ID, false, true ) . '" itemprop="url">';
323
  echo '<date>&nbsp;' . get_post_time( 'H:i:s', false, $event ) . '</date>' . apply_filters( 'sportspress_event_time', sp_get_time( $event ), $event->ID );
324
  if ( $link_events ) echo '</a>';
338
  break;
339
  case 'time':
340
  if ( sp_column_active( $usecolumns, 'time' ) ) {
341
+ echo '<td class="data-time '.$status.'" data-label="'.__( 'Time', 'sportspress' ).'">';
342
  if ( $link_events ) echo '<a href="' . get_post_permalink( $event->ID, false, true ) . '" itemprop="url">';
343
  echo '<date>&nbsp;' . get_post_time( 'H:i:s', false, $event ) . '</date>' . apply_filters( 'sportspress_event_time', sp_get_time( $event ), $event->ID );
344
  if ( $link_events ) echo '</a>';
360
  break;
361
  default:
362
  if ( sp_column_active( $usecolumns, 'time' ) ) {
363
+ echo '<td class="data-time '.$status.'" data-label="'.__( 'Time/Results', 'sportspress' ).'">';
364
  if ( $link_events ) echo '<a href="' . get_post_permalink( $event->ID, false, true ) . '" itemprop="url">';
365
  if ( ! empty( $main_results ) ):
366
  echo implode( ' - ', $main_results );
templates/event-performance-table.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
- * @version 2.5.5
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -28,6 +28,7 @@ $identifier = uniqid( 'performance_' );
28
  if ( true == $responsive && $mode == 'values' ){
29
  //sportspress_responsive_tables_css( $identifier );
30
  }
 
31
  ?>
32
  <div class="sp-template sp-template-event-performance sp-template-event-performance-<?php echo $mode; ?><?php if ( isset( $class ) ) { echo ' ' . $class; } ?>">
33
  <?php if ( $caption ): ?>
@@ -75,7 +76,6 @@ if ( true == $responsive && $mode == 'values' ){
75
 
76
  $stars_type = get_option( 'sportspress_event_performance_stars_type', 0 );
77
 
78
- $i = 0;
79
  foreach ( $data as $player_id => $row ):
80
 
81
  if ( ! $player_id )
4
  *
5
  * @author ThemeBoy
6
  * @package SportsPress/Templates
7
+ * @version 2.6.11
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
28
  if ( true == $responsive && $mode == 'values' ){
29
  //sportspress_responsive_tables_css( $identifier );
30
  }
31
+ $i = 0;
32
  ?>
33
  <div class="sp-template sp-template-event-performance sp-template-event-performance-<?php echo $mode; ?><?php if ( isset( $class ) ) { echo ' ' . $class; } ?>">
34
  <?php if ( $caption ): ?>
76
 
77
  $stars_type = get_option( 'sportspress_event_performance_stars_type', 0 );
78
 
 
79
  foreach ( $data as $player_id => $row ):
80
 
81
  if ( ! $player_id )