Fix event team limit issue, update to 0.8.6

This commit is contained in:
Brian Miyaji
2014-05-08 13:52:25 +10:00
parent dc88aff65d
commit ba579cfb9e
4 changed files with 28 additions and 23 deletions

View File

@@ -5,7 +5,7 @@
* @author ThemeBoy
* @category Admin
* @package SportsPress/Admin/Meta Boxes
* @version 0.8.4
* @version 0.8.6
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -19,8 +19,10 @@ class SP_Meta_Box_Event_Teams {
* Output the metabox
*/
public static function output( $post ) {
$limit = get_option( 'sportspress_event_teams', 2 );
$teams = (array) get_post_meta( $post->ID, 'sp_team', false );
foreach ( $teams as $key => $value ):
for ( $i = 0; $i < $limit; $i ++ ):
$team = array_shift( $teams );
?>
<div class="sp-instance">
<p class="sp-tab-select sp-title-generator">
@@ -30,7 +32,7 @@ class SP_Meta_Box_Event_Teams {
'name' => 'sp_team[]',
'class' => 'sportspress-pages',
'show_option_none' => sprintf( __( '&mdash; None &mdash;', 'sportspress' ), 'Team' ),
'selected' => $value
'selected' => $team
);
wp_dropdown_pages( $args );
?>
@@ -40,18 +42,18 @@ class SP_Meta_Box_Event_Teams {
<li class="wp-tab"><a href="#sp_staff-all"><?php _e( 'Staff', 'sportspress' ); ?></a></li>
</ul>
<?php
sp_post_checklist( $post->ID, 'sp_player', 'block', 'sp_current_team', $key );
sp_post_checklist( $post->ID, 'sp_staff', 'none', 'sp_current_team', $key );
sp_post_checklist( $post->ID, 'sp_player', 'block', 'sp_current_team', $i );
sp_post_checklist( $post->ID, 'sp_staff', 'none', 'sp_current_team', $i );
?>
</div>
<?php endforeach;
<?php
endfor;
}
/**
* Save meta box data
*/
public static function save( $post_id, $post ) {
sp_update_post_meta( $post_id, 'sp_limit', sp_array_value( $_POST, 'sp_limit', 2 ) );
sp_update_post_meta_recursive( $post_id, 'sp_team', sp_array_value( $_POST, 'sp_team', array() ) );
sp_update_post_meta_recursive( $post_id, 'sp_player', sp_array_value( $_POST, 'sp_player', array() ) );
sp_update_post_meta_recursive( $post_id, 'sp_staff', sp_array_value( $_POST, 'sp_staff', array() ) );

View File

@@ -5,7 +5,7 @@
* @author ThemeBoy
* @category Admin
* @package SportsPress/Admin
* @version 0.8
* @version 0.8.6
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

View File

@@ -1,6 +1,6 @@
=== SportsPress - sports league management ===
Contributors: ThemeBoy
Tags: sports, press, soccer, football, teams, fixtures, results, standings, league tables, leagues, world cup, statistics, stats, themeboy
Tags: sport, sports, press, club, sport statistics, sports management, soccer, football, teams, fixtures, results, standings, league tables, leagues, world cup, statistics, stats, wordpress sports, themeboy
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=support@themeboy.com&item_name=Donation+for+SportsPress
Requires at least: 3.8
Tested up to: 3.9
@@ -120,6 +120,9 @@ Yes, CSV importers are included with the plugin. Go to Tools > Import and choose
== Changelog ==
= 0.8.6 =
* Fix - Issue adding teams to events.
= 0.8.5 =
* Fix - Issue saving new venues.

View File

@@ -3,7 +3,7 @@
* Plugin Name: SportsPress
* Plugin URI: http://wordpress.org/plugins/sportspress
* Description: Manage your club and its players, staff, events, league tables, and player lists.
* Version: 0.8.5
* Version: 0.8.6
* 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 0.8.5
* @version 0.8.6
*/
final class SportsPress {
/**
* @var string
*/
public $version = '0.8.5';
public $version = '0.8.6';
/**
* @var SporsPress The single instance of the class