diff --git a/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-teams.php b/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-teams.php index 1f2c4ae2..b716f382 100644 --- a/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-teams.php +++ b/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-teams.php @@ -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 ); + ?>
- 'sp_team', - 'name' => 'sp_team[]', - 'class' => 'sportspress-pages', - 'show_option_none' => sprintf( __( '— None —', 'sportspress' ), 'Team' ), - 'selected' => $value - ); - wp_dropdown_pages( $args ); - ?> + 'sp_team', + 'name' => 'sp_team[]', + 'class' => 'sportspress-pages', + 'show_option_none' => sprintf( __( '— None —', 'sportspress' ), 'Team' ), + 'selected' => $team + ); + wp_dropdown_pages( $args ); + ?>
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 ); ?>