Fix event team limit issue, update to 0.8.6
This commit is contained in:
@@ -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,39 +19,41 @@ class SP_Meta_Box_Event_Teams {
|
||||
* Output the metabox
|
||||
*/
|
||||
public static function output( $post ) {
|
||||
$teams = (array)get_post_meta( $post->ID, 'sp_team', false );
|
||||
foreach ( $teams as $key => $value ):
|
||||
?>
|
||||
$limit = get_option( 'sportspress_event_teams', 2 );
|
||||
$teams = (array) get_post_meta( $post->ID, 'sp_team', false );
|
||||
for ( $i = 0; $i < $limit; $i ++ ):
|
||||
$team = array_shift( $teams );
|
||||
?>
|
||||
<div class="sp-instance">
|
||||
<p class="sp-tab-select sp-title-generator">
|
||||
<?php
|
||||
$args = array(
|
||||
'post_type' => 'sp_team',
|
||||
'name' => 'sp_team[]',
|
||||
'class' => 'sportspress-pages',
|
||||
'show_option_none' => sprintf( __( '— None —', 'sportspress' ), 'Team' ),
|
||||
'selected' => $value
|
||||
);
|
||||
wp_dropdown_pages( $args );
|
||||
?>
|
||||
<?php
|
||||
$args = array(
|
||||
'post_type' => 'sp_team',
|
||||
'name' => 'sp_team[]',
|
||||
'class' => 'sportspress-pages',
|
||||
'show_option_none' => sprintf( __( '— None —', 'sportspress' ), 'Team' ),
|
||||
'selected' => $team
|
||||
);
|
||||
wp_dropdown_pages( $args );
|
||||
?>
|
||||
</p>
|
||||
<ul id="sp_team-tabs" class="wp-tab-bar sp-tab-bar">
|
||||
<li class="wp-tab-active"><a href="#sp_player-all"><?php _e( 'Players', 'sportspress' ); ?></a></li>
|
||||
<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() ) );
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user