diff --git a/changelog.txt b/changelog.txt
index bee296a1..63666c01 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -1,5 +1,19 @@
== SportsPress Changelog ==
+= 2.7 =
+* Feature - New bulk actions to postpone and cancel multiple events.
+* Feature - Add date of birth to player importer.
+* Feature - Automatically select the home team's venue as the default venue when importing fixtures.
+* Feature - Add ability to turn on comment for team profiles.
+* Feature - Filter league tables by event status.
+* Tweak - When an icon is used for player performance, display the icon in player lists and profiles.
+* Tweak - Add title attribute for player statistic icons.
+* Tweak - Default stylesheet sorting icon width.
+* Fix - Icon color picker rendering issue.
+* Fix - Image selector not working for player statistics.
+* Fix - Enqueue scripts and styles for OpenStreetMap when used in shortcodes.
+* Localization - Add translation options for countdown units.
+
= 2.6.20 =
* Tweak - Improve compatibility with volleyball for checkbox performance.
* Preset - Update volleyball preset with additional options.
diff --git a/includes/admin/importers/class-sp-event-importer.php b/includes/admin/importers/class-sp-event-importer.php
index 632f5177..9fac3d72 100644
--- a/includes/admin/importers/class-sp-event-importer.php
+++ b/includes/admin/importers/class-sp-event-importer.php
@@ -479,7 +479,7 @@ if ( class_exists( 'WP_Importer' ) ) {
-
+
diff --git a/includes/admin/importers/class-sp-fixture-importer.php b/includes/admin/importers/class-sp-fixture-importer.php
index e12792e1..79be47bd 100644
--- a/includes/admin/importers/class-sp-fixture-importer.php
+++ b/includes/admin/importers/class-sp-fixture-importer.php
@@ -5,7 +5,7 @@
* @author ThemeBoy
* @category Admin
* @package SportsPress/Admin/Importers
- * @version 2.5
+ * @version 2.7
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
diff --git a/includes/admin/importers/class-sp-player-importer.php b/includes/admin/importers/class-sp-player-importer.php
index f329b167..a480abda 100644
--- a/includes/admin/importers/class-sp-player-importer.php
+++ b/includes/admin/importers/class-sp-player-importer.php
@@ -5,7 +5,7 @@
* @author ThemeBoy
* @category Admin
* @package SportsPress/Admin/Importers
- * @version 2.6.9
+ * @version 2.7
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
diff --git a/includes/admin/post-types/class-sp-admin-cpt-event.php b/includes/admin/post-types/class-sp-admin-cpt-event.php
index e145645c..8a5e1613 100644
--- a/includes/admin/post-types/class-sp-admin-cpt-event.php
+++ b/includes/admin/post-types/class-sp-admin-cpt-event.php
@@ -5,7 +5,7 @@
* @author ThemeBoy
* @category Admin
* @package SportsPress/Admin/Post_Types
- * @version 2.6.5
+ * @version 2.7
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -44,6 +44,9 @@ class SP_Admin_CPT_Event extends SP_Admin_CPT {
// Filtering
add_action( 'restrict_manage_posts', array( $this, 'filters' ) );
add_filter( 'parse_query', array( $this, 'filters_query' ) );
+
+ // Post states
+ add_filter( 'display_post_states', array( $this, 'post_states' ), 10, 2 );
// Call SP_Admin_CPT constructor
parent::__construct();
@@ -294,27 +297,47 @@ class SP_Admin_CPT_Event extends SP_Admin_CPT {
wp_nonce_field( 'sp-save-inline-results', 'sp-inline-nonce', false );
}
- /**
- * Filter in admin based on options
- *
- * @param mixed $query
- */
- public function filters_query( $query ) {
- global $typenow, $wp_query;
+ /**
+ * Filter in admin based on options
+ *
+ * @param mixed $query
+ */
+ public function filters_query( $query ) {
+ global $typenow, $wp_query;
- if ( $typenow == 'sp_event' ) {
+ if ( $typenow == 'sp_event' ) {
- if ( ! empty( $_GET['team'] ) ) {
- $query->query_vars['meta_value'] = $_GET['team'];
- $query->query_vars['meta_key'] = 'sp_team';
- }
+ if ( ! empty( $_GET['team'] ) ) {
+ $query->query_vars['meta_value'] = $_GET['team'];
+ $query->query_vars['meta_key'] = 'sp_team';
+ }
- if ( ! empty( $_GET['match_day'] ) ) {
- $query->query_vars['meta_value'] = $_GET['match_day'];
- $query->query_vars['meta_key'] = 'sp_day';
- }
- }
- }
+ if ( ! empty( $_GET['match_day'] ) ) {
+ $query->query_vars['meta_value'] = $_GET['match_day'];
+ $query->query_vars['meta_key'] = 'sp_day';
+ }
+ }
+ }
+
+ /**
+ * Replace displayed post state for events
+ *
+ * @param array $post_states
+ * @param object $post
+ */
+ public function post_states( $post_states, $post ) {
+ $status = get_post_meta( $post->ID, 'sp_status', true );
+
+ if ( 'postponed' == $status ) {
+ $post_states = array( __( 'Postponed', 'sportspress' ) );
+ } elseif ( 'cancelled' == $status ) {
+ $post_states = array( __( 'Canceled', 'sportspress' ) );
+ } elseif ( 'tbd' == $status ) {
+ $post_states = array( __( 'TBD', 'sportspress' ) );
+ }
+
+ return $post_states;
+ }
}
endif;
diff --git a/includes/admin/post-types/meta-boxes/class-sp-meta-box-table-details.php b/includes/admin/post-types/meta-boxes/class-sp-meta-box-table-details.php
index a79879f0..865d5b6d 100644
--- a/includes/admin/post-types/meta-boxes/class-sp-meta-box-table-details.php
+++ b/includes/admin/post-types/meta-boxes/class-sp-meta-box-table-details.php
@@ -5,7 +5,7 @@
* @author ThemeBoy
* @category Admin
* @package SportsPress/Admin/Meta_Boxes
- * @version 2.5.5
+ * @version 2.7
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
diff --git a/includes/admin/settings/class-sp-settings-teams.php b/includes/admin/settings/class-sp-settings-teams.php
index f7023164..d203c6a1 100644
--- a/includes/admin/settings/class-sp-settings-teams.php
+++ b/includes/admin/settings/class-sp-settings-teams.php
@@ -5,7 +5,7 @@
* @author ThemeBoy
* @category Admin
* @package SportsPress/Admin
- * @version 2.6
+ * @version 2.7
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
diff --git a/includes/class-sp-ajax.php b/includes/class-sp-ajax.php
index 00d7ac3c..1abf0592 100644
--- a/includes/class-sp-ajax.php
+++ b/includes/class-sp-ajax.php
@@ -8,7 +8,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
* AJAX Event Handler
*
* @class SP_AJAX
- * @version 2.6.15
+ * @version 2.7
* @package SportsPress/Classes
* @category Class
* @author ThemeBoy
diff --git a/includes/class-sp-league-table.php b/includes/class-sp-league-table.php
index a7d8bdb5..3b45a32a 100644
--- a/includes/class-sp-league-table.php
+++ b/includes/class-sp-league-table.php
@@ -5,7 +5,7 @@
* The SportsPress league table class handles individual league table data.
*
* @class SP_League_Table
- * @version 2.6.15
+ * @version 2.7
* @package SportsPress/Classes
* @category Class
* @author ThemeBoy
diff --git a/includes/class-sp-player-list.php b/includes/class-sp-player-list.php
index db55a0e4..f602f4f9 100644
--- a/includes/class-sp-player-list.php
+++ b/includes/class-sp-player-list.php
@@ -5,7 +5,7 @@
* The SportsPress player list class handles individual player list data.
*
* @class SP_Player_List
- * @version 2.6.19
+ * @version 2.7
* @package SportsPress/Classes
* @category Class
* @author ThemeBoy
diff --git a/includes/class-sp-player.php b/includes/class-sp-player.php
index ab7f4833..66534334 100644
--- a/includes/class-sp-player.php
+++ b/includes/class-sp-player.php
@@ -5,7 +5,7 @@
* The SportsPress player class handles individual player data.
*
* @class SP_Player
- * @version 2.6.19
+ * @version 2.7
* @package SportsPress/Classes
* @category Class
* @author ThemeBoy
diff --git a/includes/class-sp-post-types.php b/includes/class-sp-post-types.php
index a640689c..fd37d5b4 100644
--- a/includes/class-sp-post-types.php
+++ b/includes/class-sp-post-types.php
@@ -9,7 +9,7 @@ if ( ! defined( 'ABSPATH' ) ) {
* Registers post types and taxonomies
*
* @class SP_Post_types
- * @version 2.6.13
+ * @version 2.7
* @package SportsPress/Classes
* @category Class
* @author ThemeBoy
diff --git a/includes/sp-api-functions.php b/includes/sp-api-functions.php
index e4d6161a..55f31561 100644
--- a/includes/sp-api-functions.php
+++ b/includes/sp-api-functions.php
@@ -7,7 +7,7 @@
* @author ThemeBoy
* @category Core
* @package SportsPress/Functions
- * @version 2.6.6
+ * @version 2.7
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
diff --git a/includes/sp-core-functions.php b/includes/sp-core-functions.php
index 136528db..b1ce7bd2 100644
--- a/includes/sp-core-functions.php
+++ b/includes/sp-core-functions.php
@@ -7,7 +7,7 @@
* @author ThemeBoy
* @category Core
* @package SportsPress/Functions
- * @version 2.6.19
+ * @version 2.7
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
diff --git a/license.txt b/license.txt
index 238d4723..25d41796 100644
--- a/license.txt
+++ b/license.txt
@@ -1,6 +1,6 @@
SportsPress
-Copyright 2019 by the contributors
+Copyright 2020 by the contributors
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/modules/sportspress-bulk-actions.php b/modules/sportspress-bulk-actions.php
index c95b19b0..985ee569 100644
--- a/modules/sportspress-bulk-actions.php
+++ b/modules/sportspress-bulk-actions.php
@@ -5,7 +5,7 @@ Plugin URI: http://themeboy.com/
Description: Add bulk actions to SportsPress.
Author: ThemeBoy
Author URI: http://themeboy.com/
-Version: 2.2
+Version: 2.7
*/
// Exit if accessed directly
@@ -17,89 +17,145 @@ if ( ! class_exists( 'SportsPress_Bulk_Actions' ) ) :
* Main SportsPress Bulk Actions Class
*
* @class SportsPress_Bulk_Actions
- * @version 2.2
+ * @version 2.7
*/
class SportsPress_Bulk_Actions {
- /**
- * Constructor
- */
- public function __construct() {
- // Define constants
- $this->define_constants();
+ /**
+ * Constructor
+ */
+ public function __construct() {
+ // Define constants
+ $this->define_constants();
- // Teams
- add_filter( 'bulk_actions-edit-sp_team', array( $this, 'team_actions' ) );
- add_filter( 'handle_bulk_actions-edit-sp_team', array( $this, 'team_actions_handler' ), 10, 3 );
- add_action( 'admin_notices', array( $this, 'admin_notices' ) );
- }
+ // Teams
+ add_filter( 'bulk_actions-edit-sp_team', array( $this, 'team_actions' ) );
+ add_filter( 'handle_bulk_actions-edit-sp_team', array( $this, 'team_actions_handler' ), 10, 3 );
- /**
- * Define constants.
- */
- private function define_constants() {
- if ( !defined( 'SP_BULK_ACTIONS_VERSION' ) )
- define( 'SP_BULK_ACTIONS_VERSION', '2.2' );
+ // Events
+ add_filter( 'bulk_actions-edit-sp_event', array( $this, 'event_actions' ) );
+ add_filter( 'handle_bulk_actions-edit-sp_event', array( $this, 'event_actions_handler' ), 10, 3 );
- if ( !defined( 'SP_BULK_ACTIONS_URL' ) )
- define( 'SP_BULK_ACTIONS_URL', plugin_dir_url( __FILE__ ) );
+ // Notices
+ add_action( 'admin_notices', array( $this, 'admin_notices' ) );
+ }
- if ( !defined( 'SP_BULK_ACTIONS_DIR' ) )
- define( 'SP_BULK_ACTIONS_DIR', plugin_dir_path( __FILE__ ) );
- }
+ /**
+ * Define constants.
+ */
+ private function define_constants() {
+ if ( !defined( 'SP_BULK_ACTIONS_VERSION' ) )
+ define( 'SP_BULK_ACTIONS_VERSION', '2.7' );
- /**
- * Add option to the team bulk actions dropdown.
- */
- public function team_actions( $bulk_actions ) {
- $bulk_actions['sp_calendar'] = __( 'Generate Calendars', 'sportspress' );
- return $bulk_actions;
- }
+ if ( !defined( 'SP_BULK_ACTIONS_URL' ) )
+ define( 'SP_BULK_ACTIONS_URL', plugin_dir_url( __FILE__ ) );
- /**
- * Handle form submission for team bulk actions.
- */
- public function team_actions_handler( $redirect_to, $doaction, $post_ids ) {
- if ( $doaction !== 'sp_calendar' ) {
- return $redirect_to;
- }
+ if ( !defined( 'SP_BULK_ACTIONS_DIR' ) )
+ define( 'SP_BULK_ACTIONS_DIR', plugin_dir_path( __FILE__ ) );
+ }
- foreach ( $post_ids as $post_id ) {
- $post = array();
- $post['post_title'] = get_the_title( $post_id ) . ' ' . __( 'Calendar', 'sportspress' );
- $post['post_type'] = 'sp_calendar';
- $post['post_status'] = 'publish';
+ /**
+ * Add option to the team bulk actions dropdown.
+ */
+ public function team_actions( $bulk_actions ) {
+ $bulk_actions['sp_calendar'] = __( 'Generate Calendars', 'sportspress' );
+ return $bulk_actions;
+ }
- // Insert post
- $id = wp_insert_post( $post );
+ /**
+ * Handle form submission for team bulk actions.
+ */
+ public function team_actions_handler( $redirect_to, $doaction, $post_ids ) {
+ if ( $doaction !== 'sp_calendar' ) {
+ return $redirect_to;
+ }
- // Flag as bulk
- update_post_meta( $id, '_sp_bulk', 1 );
+ foreach ( $post_ids as $post_id ) {
+ $post = array();
+ $post['post_title'] = get_the_title( $post_id ) . ' ' . __( 'Calendar', 'sportspress' );
+ $post['post_type'] = 'sp_calendar';
+ $post['post_status'] = 'publish';
- // Update meta
- update_post_meta( $id, 'sp_team', $post_id );
- update_post_meta( $id, 'sp_format', 'calendar' );
- }
+ // Insert post
+ $id = wp_insert_post( $post );
- $redirect_to = add_query_arg( 'sp_bulk_generated_calendars', count( $post_ids ), $redirect_to );
- return $redirect_to;
- }
+ // Flag as bulk
+ update_post_meta( $id, '_sp_bulk', 1 );
- /**
- * Display notices after form submission.
- */
- public function admin_notices() {
- if ( ! empty( $_REQUEST['sp_bulk_generated_calendars'] ) ) {
- $count = intval( $_REQUEST['sp_bulk_generated_calendars'] );
+ // Update meta
+ update_post_meta( $id, 'sp_team', $post_id );
+ update_post_meta( $id, 'sp_format', 'calendar' );
+ }
- printf( '
' . - _n( 'Generated %s calendar.', - 'Generated %s calendars.', - $count, - 'sportspress' - ) . ' ' . __( 'View', 'sportspress' ) . '
' . + _n( 'Generated %s calendar.', + 'Generated %s calendars.', + $count, + 'sportspress' + ) . ' ' . __( 'View', 'sportspress' ) . '
' . + _n( 'Postponed %s event.', + 'Postponed %s events.', + $count, + 'sportspress' + ) . '
' . + _n( 'Canceled %s event.', + 'Canceled %s events.', + $count, + 'sportspress' + ) . '