diff --git a/changelog.txt b/changelog.txt index 4df34599..b2d6f646 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,11 @@ == SportsPress Changelog == += 2.6.3 = +* Fix - Assign past teams during player import. +* Fix - Next team column displaying events furthest away. +* Fix - Add fallback array_replace function for PHP versions earlier than 5.3. +* Fix - Add fallback for web hosts that don't support multibyte PHP functions, causing blank player profiles. + = 2.6.2 = * Fix - Newly added players from past and current team appearing in player lists. * Fix - Player lists appearing empty without league, season, and team selected. diff --git a/includes/admin/importers/class-sp-player-importer.php b/includes/admin/importers/class-sp-player-importer.php index c513b84f..cfe04fd6 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 + * @version 2.6.3 */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly @@ -123,9 +123,11 @@ if ( class_exists( 'WP_Importer' ) ) { // Add team to player add_post_meta( $id, 'sp_team', $team_id ); - // Update current team if first in array + // Update current team if first in array, otherwise use as past team if ( $i == 0 ): update_post_meta( $id, 'sp_current_team', $team_id ); + else : + add_post_meta( $id, 'sp_past_team', $team_id ); endif; $i++; diff --git a/includes/admin/post-types/meta-boxes/class-sp-meta-box-outcome-details.php b/includes/admin/post-types/meta-boxes/class-sp-meta-box-outcome-details.php index 2b44744b..5148df9b 100644 --- a/includes/admin/post-types/meta-boxes/class-sp-meta-box-outcome-details.php +++ b/includes/admin/post-types/meta-boxes/class-sp-meta-box-outcome-details.php @@ -5,7 +5,7 @@ * @author ThemeBoy * @category Admin * @package SportsPress/Admin/Meta_Boxes - * @version 2.6 + * @version 2.6.3 */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly diff --git a/includes/class-sp-player.php b/includes/class-sp-player.php index d2959bad..5ecafa73 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.1 + * @version 2.6.3 * @package SportsPress/Classes * @category Class * @author ThemeBoy diff --git a/includes/class-sp-team.php b/includes/class-sp-team.php index 71299822..0a671086 100644 --- a/includes/class-sp-team.php +++ b/includes/class-sp-team.php @@ -5,7 +5,7 @@ * The SportsPress team class handles individual team data. * * @class SP_Team - * @version 2.6 + * @version 2.6.3 * @package SportsPress/Classes * @category Class * @author ThemeBoy diff --git a/includes/sp-api-functions.php b/includes/sp-api-functions.php index c7f5f81b..ed2e6105 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 + * @version 2.6.3 */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly diff --git a/includes/sp-core-functions.php b/includes/sp-core-functions.php index 59dfeb47..6b7740fe 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 + * @version 2.6.3 */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly @@ -1636,3 +1636,28 @@ function sp_get_shortcode_template( $shortcode, $id = null, $args = array() ) { function sp_shortcode_template( $shortcode, $id = null, $args = array() ) { echo sp_get_shortcode_template( $shortcode, $id, $args ); } + +if( ! function_exists( 'array_replace' ) ) { + /** + * array_replace for PHP version earlier than 5.3 + * + * @link http://be2.php.net/manual/fr/function.array-replace.php#115215 + */ + function array_replace() { + $args = func_get_args(); + $num_args = func_num_args(); + $res = array(); + for( $i = 0; $i < $num_args; $i++ ) { + if( is_array( $args[ $i ] ) ) { + foreach( $args[ $i ] as $key => $val ) { + $res[ $key ] = $val; + } + } + else { + trigger_error( __FUNCTION__ . '(): Argument #' . ( $i + 1 ) . ' is not an array', E_USER_WARNING ); + return NULL; + } + } + return $res; + } +} diff --git a/modules/sportspress-next-team-preset.php b/modules/sportspress-next-team-preset.php index ca7dd434..3f609557 100644 --- a/modules/sportspress-next-team-preset.php +++ b/modules/sportspress-next-team-preset.php @@ -5,7 +5,7 @@ Plugin URI: http://themeboy.com/ Description: Add a Next preset to SportsPress league table column equations. Author: ThemeBoy Author URI: http://themeboy.com/ -Version: 2.6 +Version: 2.6.3 */ // Exit if accessed directly @@ -17,7 +17,7 @@ if ( ! class_exists( 'SportsPress_Next_Team_Preset' ) ) : * Main SportsPress Next Team Preset Class * * @class SportsPress_Next_Team_Preset - * @version 2.6 + * @version 2.6.3 */ class SportsPress_Next_Team_Preset { @@ -46,7 +46,7 @@ if ( ! class_exists( 'SportsPress_Next_Team_Preset' ) ) : */ private function define_constants() { if ( !defined( 'SP_NEXT_TEAM_PRESET_VERSION' ) ) - define( 'SP_NEXT_TEAM_PRESET_VERSION', '2.6' ); + define( 'SP_NEXT_TEAM_PRESET_VERSION', '2.6.3' ); if ( !defined( 'SP_NEXT_TEAM_PRESET_URL' ) ) define( 'SP_NEXT_TEAM_PRESET_URL', plugin_dir_url( __FILE__ ) ); @@ -94,6 +94,7 @@ if ( ! class_exists( 'SportsPress_Next_Team_Preset' ) ) : 'compare' => 'IN', ), ), + 'order' => 'ASC', ); $events = get_posts( $args ); diff --git a/readme.txt b/readme.txt index c3538199..88a533ac 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: calendars, club, club management, esports, events, fixtures, leagues, leag Donate link: http://tboy.co/donate Requires at least: 3.8 Tested up to: 4.9 -Stable tag: 2.6.2 +Stable tag: 2.6.3 License: GPLv3 License URI: http://www.gnu.org/licenses/gpl-3.0.html @@ -237,6 +237,12 @@ When you upgrade to one of the SportsPress Pro licenses, you can simply activate == Changelog == += 2.6.3 = +* Fix - Assign past teams during player import. +* Fix - Next team column displaying events furthest away. +* Fix - Add fallback array_replace function for PHP versions earlier than 5.3. +* Fix - Add fallback for web hosts that don't support multibyte PHP functions, causing blank player profiles. + = 2.6.2 = * Fix - Newly added players from past and current team appearing in player lists. * Fix - Player lists appearing empty without league, season, and team selected. diff --git a/sportspress.php b/sportspress.php index b2176dc5..11bf703c 100644 --- a/sportspress.php +++ b/sportspress.php @@ -3,7 +3,7 @@ * Plugin Name: SportsPress * Plugin URI: http://themeboy.com/sportspress/ * Description: Manage your club and its players, staff, events, league tables, and player lists. - * Version: 2.6.2 + * Version: 2.6.3 * Author: ThemeBoy * Author URI: http://themeboy.com * Requires at least: 3.8 @@ -26,14 +26,14 @@ if ( ! class_exists( 'SportsPress' ) ) : * Main SportsPress Class * * @class SportsPress - * @version 2.6.2 + * @version 2.6.3 */ final class SportsPress { /** * @var string */ - public $version = '2.6.2'; + public $version = '2.6.3'; /** * @var SportsPress The single instance of the class