SportsPress – Sports Club & League Manager - Version 2.6.18

Version Description

  • Fix - Prevent OpenStreetMap scripts from loading when Google Maps is active via SportsPress Pro.
  • Fix - Headers already sent error related to default nationality module.
Download this release

Release Info

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

Code changes from version 2.6.17 to 2.6.18

changelog.txt CHANGED
@@ -1,5 +1,9 @@
1
  == SportsPress Changelog ==
2
 
 
 
 
 
3
  = 2.6.17 =
4
  * Tweak - Only show welcome screen on major version upgrade.
5
  * Tweak - Add filters to enable career totals calculation with extensions.
1
  == SportsPress Changelog ==
2
 
3
+ = 2.6.18 =
4
+ * Fix - Prevent OpenStreetMap scripts from loading when Google Maps is active via SportsPress Pro.
5
+ * Fix - Headers already sent error related to default nationality module.
6
+
7
  = 2.6.17 =
8
  * Tweak - Only show welcome screen on major version upgrade.
9
  * Tweak - Add filters to enable career totals calculation with extensions.
modules/sportspress-default-nationality.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://themeboy.com/
5
  Description: Add default nationality option to SportsPress Settings.
6
  Author: ThemeBoy
7
  Author URI: http://themeboy.com/
8
- Version: 2.6.9
9
  */
10
 
11
  // Exit if accessed directly
@@ -17,7 +17,7 @@ if ( ! class_exists( 'SportsPress_Default_Nationality' ) ) :
17
  * Main SportsPress Default Nationality Class
18
  *
19
  * @class SportsPress_Default_Nationality
20
- * @version 2.6.9
21
  */
22
  class SportsPress_Default_Nationality {
23
 
@@ -36,7 +36,7 @@ class SportsPress_Default_Nationality {
36
  */
37
  private function define_constants() {
38
  if ( !defined( 'SP_DEFAULT_NATIONALITY_VERSION' ) )
39
- define( 'SP_DEFAULT_NATIONALITY_VERSION', '2.6.9' );
40
 
41
  if ( !defined( 'SP_DEFAULT_NATIONALITY_URL' ) )
42
  define( 'SP_DEFAULT_NATIONALITY_URL', plugin_dir_url( __FILE__ ) );
@@ -50,7 +50,9 @@ class SportsPress_Default_Nationality {
50
  */
51
  public function add_general_options( $settings ) {
52
  $countries[''] = __( '— None —', 'sportspress' );
53
- $countries = array_merge ( $countries, SP()->countries->countries );
 
 
54
  $settings[]=array(
55
  'title' => __( 'Default Nationality', 'sportspress' ),
56
  'id' => 'sportspress_default_nationality',
5
  Description: Add default nationality option to SportsPress Settings.
6
  Author: ThemeBoy
7
  Author URI: http://themeboy.com/
8
+ Version: 2.6.18
9
  */
10
 
11
  // Exit if accessed directly
17
  * Main SportsPress Default Nationality Class
18
  *
19
  * @class SportsPress_Default_Nationality
20
+ * @version 2.6.18
21
  */
22
  class SportsPress_Default_Nationality {
23
 
36
  */
37
  private function define_constants() {
38
  if ( !defined( 'SP_DEFAULT_NATIONALITY_VERSION' ) )
39
+ define( 'SP_DEFAULT_NATIONALITY_VERSION', '2.6.18' );
40
 
41
  if ( !defined( 'SP_DEFAULT_NATIONALITY_URL' ) )
42
  define( 'SP_DEFAULT_NATIONALITY_URL', plugin_dir_url( __FILE__ ) );
50
  */
51
  public function add_general_options( $settings ) {
52
  $countries[''] = __( '— None —', 'sportspress' );
53
+ $sp_countries = new SP_Countries();
54
+ $countries = array_merge ( $countries, $sp_countries->countries );
55
+
56
  $settings[]=array(
57
  'title' => __( 'Default Nationality', 'sportspress' ),
58
  'id' => 'sportspress_default_nationality',
modules/sportspress-openstreetmap.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://themeboy.com/
5
  Description: Integrate OpenStreetMap to SportsPress.
6
  Author: ThemeBoy
7
  Author URI: http://themeboy.com/
8
- Version: 2.6.15
9
  */
10
 
11
  // Exit if accessed directly
@@ -17,7 +17,7 @@ if ( ! class_exists( 'SportsPress_OpenStreetMap' ) ):
17
  * Main SportsPress OpenStreetMap Class
18
  *
19
  * @class SportsPress_OpenStreetMap
20
- * @version 2.6.15
21
  */
22
 
23
  class SportsPress_OpenStreetMap {
@@ -30,8 +30,9 @@ if ( ! class_exists( 'SportsPress_OpenStreetMap' ) ):
30
  $this->define_constants();
31
 
32
  // Actions
33
- add_action( 'admin_enqueue_scripts', array( $this, 'admin_styles' ) );
34
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ) );
 
 
35
  add_action( 'wp_enqueue_scripts', array( $this, 'frontend_scripts' ) );
36
  add_action( 'sp_venue_show_map', array( $this, 'show_venue_map' ), 10, 5 );
37
  add_action( 'sp_admin_geocoder_scripts', array( $this, 'admin_geocoder_scripts' ), 10 );
@@ -44,7 +45,7 @@ if ( ! class_exists( 'SportsPress_OpenStreetMap' ) ):
44
  */
45
  private function define_constants() {
46
  if ( !defined( 'SP_OPENSTREETMAP_VERSION' ) )
47
- define( 'SP_OPENSTREETMAP_VERSION', '2.6.15' );
48
 
49
  if ( !defined( 'SP_OPENSTREETMAP_URL' ) )
50
  define( 'SP_OPENSTREETMAP_URL', plugin_dir_url( __FILE__ ) );
@@ -54,31 +55,33 @@ if ( ! class_exists( 'SportsPress_OpenStreetMap' ) ):
54
  }
55
 
56
  /**
57
- * Enqueue admin styles
58
  */
59
- public function admin_styles( $hook ) {
60
- $screen = get_current_screen();
61
- if ( in_array( $screen->id, sp_get_screen_ids() ) ) {
62
- wp_enqueue_style( 'leaflet_stylesheet', SP()->plugin_url() . '/assets/css/leaflet.css', array(), '1.4.0' );
63
- wp_enqueue_style( 'control-geocoder', SP()->plugin_url() . '/assets/css/Control.Geocoder.css', array() );
64
- }
65
  }
66
 
67
  /**
68
- * Enqueue admin scripts
69
  */
70
- public function admin_scripts( $hook ) {
71
  $screen = get_current_screen();
 
 
 
 
 
 
72
  if ( in_array( $screen->id, sp_get_screen_ids() ) ) {
73
  wp_register_script( 'leaflet_js', SP()->plugin_url() . '/assets/js/leaflet.js', array(), '1.4.0' );
74
  wp_register_script( 'control-geocoder', SP()->plugin_url() . '/assets/js/Control.Geocoder.js', array( 'leaflet_js' ) );
75
  wp_register_script( 'sportspress-admin-geocoder', SP()->plugin_url() . '/assets/js/admin/sp-geocoder.js', array( 'leaflet_js', 'control-geocoder' ), SP_VERSION, true );
76
  }
77
- // Edit venue pages
78
- if ( in_array( $screen->id, array( 'edit-sp_venue' ) ) ) {
79
- wp_enqueue_script( 'leaflet_js' );
80
- wp_enqueue_script( 'control-geocoder' );
81
- wp_enqueue_script( 'sportspress-admin-geocoder' );
82
  }
83
  }
84
 
@@ -86,6 +89,13 @@ if ( ! class_exists( 'SportsPress_OpenStreetMap' ) ):
86
  * Enqueue frontend scripts
87
  */
88
  public function frontend_scripts() {
 
 
 
 
 
 
 
89
  if( ( is_single() || is_tax() ) && get_post_type()=='sp_event' ){
90
  wp_enqueue_style( 'leaflet_stylesheet', SP()->plugin_url() . '/assets/css/leaflet.css', array(), '1.4.0' );
91
  wp_enqueue_script( 'leaflet_js', SP()->plugin_url() . '/assets/js/leaflet.js', array(), '1.4.0' );
5
  Description: Integrate OpenStreetMap to SportsPress.
6
  Author: ThemeBoy
7
  Author URI: http://themeboy.com/
8
+ Version: 2.6.18
9
  */
10
 
11
  // Exit if accessed directly
17
  * Main SportsPress OpenStreetMap Class
18
  *
19
  * @class SportsPress_OpenStreetMap
20
+ * @version 2.6.18
21
  */
22
 
23
  class SportsPress_OpenStreetMap {
30
  $this->define_constants();
31
 
32
  // Actions
 
33
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ) );
34
+ add_action( 'sp_admin_venue_scripts', array( $this, 'admin_venue_scripts' ) );
35
+ add_action( 'sp_frontend_venue_scripts', array( $this, 'frontend_venue_scripts' ) );
36
  add_action( 'wp_enqueue_scripts', array( $this, 'frontend_scripts' ) );
37
  add_action( 'sp_venue_show_map', array( $this, 'show_venue_map' ), 10, 5 );
38
  add_action( 'sp_admin_geocoder_scripts', array( $this, 'admin_geocoder_scripts' ), 10 );
45
  */
46
  private function define_constants() {
47
  if ( !defined( 'SP_OPENSTREETMAP_VERSION' ) )
48
+ define( 'SP_OPENSTREETMAP_VERSION', '2.6.18' );
49
 
50
  if ( !defined( 'SP_OPENSTREETMAP_URL' ) )
51
  define( 'SP_OPENSTREETMAP_URL', plugin_dir_url( __FILE__ ) );
55
  }
56
 
57
  /**
58
+ * Enqueue admin scripts
59
  */
60
+ public function admin_scripts() {
61
+ do_action( 'sp_admin_venue_scripts' );
 
 
 
 
62
  }
63
 
64
  /**
65
+ * Enqueue admin venue scripts
66
  */
67
+ public function admin_venue_scripts() {
68
  $screen = get_current_screen();
69
+
70
+ if ( in_array( $screen->id, sp_get_screen_ids() ) ) {
71
+ wp_enqueue_style( 'leaflet_stylesheet', SP()->plugin_url() . '/assets/css/leaflet.css', array(), '1.4.0' );
72
+ wp_enqueue_style( 'control-geocoder', SP()->plugin_url() . '/assets/css/Control.Geocoder.css', array() );
73
+ }
74
+
75
  if ( in_array( $screen->id, sp_get_screen_ids() ) ) {
76
  wp_register_script( 'leaflet_js', SP()->plugin_url() . '/assets/js/leaflet.js', array(), '1.4.0' );
77
  wp_register_script( 'control-geocoder', SP()->plugin_url() . '/assets/js/Control.Geocoder.js', array( 'leaflet_js' ) );
78
  wp_register_script( 'sportspress-admin-geocoder', SP()->plugin_url() . '/assets/js/admin/sp-geocoder.js', array( 'leaflet_js', 'control-geocoder' ), SP_VERSION, true );
79
  }
80
+
81
+ if ( in_array( $screen->id, array( 'edit-sp_venue' ) ) ) {
82
+ wp_enqueue_script( 'leaflet_js' );
83
+ wp_enqueue_script( 'control-geocoder' );
84
+ wp_enqueue_script( 'sportspress-admin-geocoder' );
85
  }
86
  }
87
 
89
  * Enqueue frontend scripts
90
  */
91
  public function frontend_scripts() {
92
+ do_action( 'sp_frontend_venue_scripts' );
93
+ }
94
+
95
+ /**
96
+ * Enqueue frontend venue scripts
97
+ */
98
+ public function frontend_venue_scripts() {
99
  if( ( is_single() || is_tax() ) && get_post_type()=='sp_event' ){
100
  wp_enqueue_style( 'leaflet_stylesheet', SP()->plugin_url() . '/assets/css/leaflet.css', array(), '1.4.0' );
101
  wp_enqueue_script( 'leaflet_js', SP()->plugin_url() . '/assets/js/leaflet.js', array(), '1.4.0' );
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.2
7
- Stable tag: 2.6.17
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -237,6 +237,10 @@ When you upgrade to one of the SportsPress Pro licenses, you can simply activate
237
 
238
  == Changelog ==
239
 
 
 
 
 
240
  = 2.6.17 =
241
  * Tweak - Only show welcome screen on major version upgrade.
242
  * Tweak - Add filters to enable career totals calculation with extensions.
4
  Donate link: http://tboy.co/donate
5
  Requires at least: 3.8
6
  Tested up to: 5.2
7
+ Stable tag: 2.6.18
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
237
 
238
  == Changelog ==
239
 
240
+ = 2.6.18 =
241
+ * Fix - Prevent OpenStreetMap scripts from loading when Google Maps is active via SportsPress Pro.
242
+ * Fix - Headers already sent error related to default nationality module.
243
+
244
  = 2.6.17 =
245
  * Tweak - Only show welcome screen on major version upgrade.
246
  * Tweak - Add filters to enable career totals calculation with extensions.
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.17
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.17
30
  */
31
  final class SportsPress {
32
 
33
  /**
34
  * @var string
35
  */
36
- public $version = '2.6.17';
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.18
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.18
30
  */
31
  final class SportsPress {
32
 
33
  /**
34
  * @var string
35
  */
36
+ public $version = '2.6.18';
37
 
38
  /**
39
  * @var SportsPress The single instance of the class