SportsPress – Sports Club & League Manager - Version 2.7.6

Version Description

  • Feature - Add ability to bulk set events as on time.
  • Fix - Players in events not being filtered by team.
Download this release

Release Info

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

Code changes from version 2.7.5 to 2.7.6

changelog.txt CHANGED
@@ -1,5 +1,9 @@
1
  == SportsPress Changelog ==
2
 
 
 
 
 
3
  = 2.7.5 =
4
  * Tweak - Add ability to filter events by team and match day in one query.
5
  * Tweak - Improve performance by updating leaflet script and only loading when required.
1
  == SportsPress Changelog ==
2
 
3
+ = 2.7.6 =
4
+ * Feature - Add ability to bulk set events as on time.
5
+ * Fix - Players in events not being filtered by team.
6
+
7
  = 2.7.5 =
8
  * Tweak - Add ability to filter events by team and match day in one query.
9
  * Tweak - Improve performance by updating leaflet script and only loading when required.
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.7.5
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -306,7 +306,7 @@ class SP_Admin_CPT_Event extends SP_Admin_CPT {
306
  global $typenow, $wp_query;
307
 
308
  if ( $typenow == 'sp_event' ) {
309
- $query->query_vars['meta_query'] = array( 'relation' => 'AND' );
310
 
311
  if ( ! empty( $_GET['team'] ) ) {
312
  $query->query_vars['meta_query'][] = array(
5
  * @author ThemeBoy
6
  * @category Admin
7
  * @package SportsPress/Admin/Post_Types
8
+ * @version 2.7.6
9
  */
10
 
11
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
306
  global $typenow, $wp_query;
307
 
308
  if ( $typenow == 'sp_event' ) {
309
+ $query->query_vars['meta_query']['relation'] = 'AND';
310
 
311
  if ( ! empty( $_GET['team'] ) ) {
312
  $query->query_vars['meta_query'][] = array(
modules/sportspress-bulk-actions.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://themeboy.com/
5
  Description: Add bulk actions to SportsPress.
6
  Author: ThemeBoy
7
  Author URI: http://themeboy.com/
8
- Version: 2.7
9
  */
10
 
11
  // Exit if accessed directly
@@ -17,7 +17,7 @@ if ( ! class_exists( 'SportsPress_Bulk_Actions' ) ) :
17
  * Main SportsPress Bulk Actions Class
18
  *
19
  * @class SportsPress_Bulk_Actions
20
- * @version 2.7
21
  */
22
  class SportsPress_Bulk_Actions {
23
 
@@ -45,7 +45,7 @@ class SportsPress_Bulk_Actions {
45
  */
46
  private function define_constants() {
47
  if ( !defined( 'SP_BULK_ACTIONS_VERSION' ) )
48
- define( 'SP_BULK_ACTIONS_VERSION', '2.7' );
49
 
50
  if ( !defined( 'SP_BULK_ACTIONS_URL' ) )
51
  define( 'SP_BULK_ACTIONS_URL', plugin_dir_url( __FILE__ ) );
@@ -97,6 +97,7 @@ class SportsPress_Bulk_Actions {
97
  public function event_actions( $bulk_actions ) {
98
  $bulk_actions['sp_postpone'] = __( 'Postpone events', 'sportspress' );
99
  $bulk_actions['sp_cancel'] = __( 'Cancel events', 'sportspress' );
 
100
  return $bulk_actions;
101
  }
102
 
@@ -104,21 +105,26 @@ class SportsPress_Bulk_Actions {
104
  * Handle form submission for event bulk actions.
105
  */
106
  public function event_actions_handler( $redirect_to, $doaction, $post_ids ) {
107
- if ( ! in_array( $doaction, array( 'sp_postpone', 'sp_cancel' ) ) ) {
108
  return $redirect_to;
109
  }
110
 
111
- if ( 'sp_postpone' == $doaction ) {
112
- foreach ( $post_ids as $post_id ) {
113
- update_post_meta( $post_id, 'sp_status', 'postponed' );
114
- }
115
- $redirect_to = add_query_arg( 'sp_bulk_postponed_events', count( $post_ids ), $redirect_to );
116
- } elseif ( 'sp_cancel' == $doaction ) {
117
- foreach ( $post_ids as $post_id ) {
118
- update_post_meta( $post_id, 'sp_status', 'cancelled' );
119
- }
120
- $redirect_to = add_query_arg( 'sp_bulk_cancelled_events', count( $post_ids ), $redirect_to );
121
- }
 
 
 
 
 
122
 
123
  return $redirect_to;
124
  }
@@ -154,6 +160,15 @@ class SportsPress_Bulk_Actions {
154
  $count,
155
  'sportspress'
156
  ) . '</p><button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button></div>', $count );
 
 
 
 
 
 
 
 
 
157
  }
158
  }
159
  }
5
  Description: Add bulk actions to SportsPress.
6
  Author: ThemeBoy
7
  Author URI: http://themeboy.com/
8
+ Version: 2.7.6
9
  */
10
 
11
  // Exit if accessed directly
17
  * Main SportsPress Bulk Actions Class
18
  *
19
  * @class SportsPress_Bulk_Actions
20
+ * @version 2.7.6
21
  */
22
  class SportsPress_Bulk_Actions {
23
 
45
  */
46
  private function define_constants() {
47
  if ( !defined( 'SP_BULK_ACTIONS_VERSION' ) )
48
+ define( 'SP_BULK_ACTIONS_VERSION', '2.7.6' );
49
 
50
  if ( !defined( 'SP_BULK_ACTIONS_URL' ) )
51
  define( 'SP_BULK_ACTIONS_URL', plugin_dir_url( __FILE__ ) );
97
  public function event_actions( $bulk_actions ) {
98
  $bulk_actions['sp_postpone'] = __( 'Postpone events', 'sportspress' );
99
  $bulk_actions['sp_cancel'] = __( 'Cancel events', 'sportspress' );
100
+ $bulk_actions['sp_ok'] = __( 'Set events as on time', 'sportspress' );
101
  return $bulk_actions;
102
  }
103
 
105
  * Handle form submission for event bulk actions.
106
  */
107
  public function event_actions_handler( $redirect_to, $doaction, $post_ids ) {
108
+ if ( ! in_array( $doaction, array( 'sp_postpone', 'sp_cancel', 'sp_ok' ) ) ) {
109
  return $redirect_to;
110
  }
111
 
112
+ if ( 'sp_postpone' == $doaction ) {
113
+ foreach ( $post_ids as $post_id ) {
114
+ update_post_meta( $post_id, 'sp_status', 'postponed' );
115
+ }
116
+ $redirect_to = add_query_arg( 'sp_bulk_postponed_events', count( $post_ids ), $redirect_to );
117
+ } elseif ( 'sp_cancel' == $doaction ) {
118
+ foreach ( $post_ids as $post_id ) {
119
+ update_post_meta( $post_id, 'sp_status', 'cancelled' );
120
+ }
121
+ $redirect_to = add_query_arg( 'sp_bulk_cancelled_events', count( $post_ids ), $redirect_to );
122
+ } elseif ( 'sp_ok' == $doaction ) {
123
+ foreach ( $post_ids as $post_id ) {
124
+ update_post_meta( $post_id, 'sp_status', 'ok' );
125
+ }
126
+ $redirect_to = add_query_arg( 'sp_bulk_ok_events', count( $post_ids ), $redirect_to );
127
+ }
128
 
129
  return $redirect_to;
130
  }
160
  $count,
161
  'sportspress'
162
  ) . '</p><button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button></div>', $count );
163
+ } elseif ( ! empty( $_REQUEST['sp_bulk_ok_events'] ) ) {
164
+ $count = intval( $_REQUEST['sp_bulk_ok_events'] );
165
+
166
+ printf( '<div id="message" class="updated notice notice-success is-dismissible"><p>' .
167
+ _n( 'Set %s event as on time.',
168
+ 'Set %s event as on time.',
169
+ $count,
170
+ 'sportspress'
171
+ ) . '</p><button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button></div>', $count );
172
  }
173
  }
174
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: calendars, club, club management, esports, events, fixtures, leagues, leag
4
  Donate link: http://tboy.co/donate
5
  Requires at least: 3.8
6
  Tested up to: 5.6
7
- Stable tag: 2.7.5
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -240,6 +240,10 @@ When you upgrade to one of the SportsPress Pro licenses, you can simply activate
240
 
241
  == Changelog ==
242
 
 
 
 
 
243
  = 2.7.5 =
244
  * Tweak - Add ability to filter events by team and match day in one query.
245
  * Tweak - Improve performance by updating leaflet script and only loading when required.
4
  Donate link: http://tboy.co/donate
5
  Requires at least: 3.8
6
  Tested up to: 5.6
7
+ Stable tag: 2.7.6
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
240
 
241
  == Changelog ==
242
 
243
+ = 2.7.6 =
244
+ * Feature - Add ability to bulk set events as on time.
245
+ * Fix - Players in events not being filtered by team.
246
+
247
  = 2.7.5 =
248
  * Tweak - Add ability to filter events by team and match day in one query.
249
  * Tweak - Improve performance by updating leaflet script and only loading when required.
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.7.5
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.7.5
30
  */
31
  final class SportsPress {
32
 
33
  /**
34
  * @var string
35
  */
36
- public $version = '2.7.5';
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.6
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.7.6
30
  */
31
  final class SportsPress {
32
 
33
  /**
34
  * @var string
35
  */
36
+ public $version = '2.7.6';
37
 
38
  /**
39
  * @var SportsPress The single instance of the class