diff --git a/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php b/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php index bab33ee1..be80b134 100644 --- a/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php +++ b/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php @@ -70,10 +70,14 @@ class SP_Meta_Box_Event_Performance { */ public static function save( $post_id, $post ) { update_post_meta( $post_id, 'sp_players', sp_array_value( $_POST, 'sp_players', array() ) ); - update_post_meta( $post_id, 'sp_columns', sp_array_value( $_POST, 'sp_columns', array() ) ); update_post_meta( $post_id, 'sp_order', sp_array_value( $_POST, 'sp_order', array() ) ); update_post_meta( $post_id, 'sp_timeline', sp_array_value( $_POST, 'sp_timeline', array() ) ); update_post_meta( $post_id, 'sp_stars', sp_array_value( $_POST, 'sp_stars', array() ) ); + + if ( isset( $_POST['sp_columns'] ) ) { + $columns = array_filter( (array) $_POST['sp_columns'] ); + update_post_meta( $post_id, 'sp_columns', $columns ); + } } /** @@ -81,8 +85,9 @@ class SP_Meta_Box_Event_Performance { */ public static function tables( $post_id, $stats = array(), $labels = array(), $columns = array(), $teams = array(), $has_checkboxes = false, $positions = array(), $status = true, $formats = array(), $order = array(), $numbers = true, $is_individual = false, $timeline = array(), $timed = array(), $stars = array() ) { $sections = get_option( 'sportspress_event_performance_sections', -1 ); - - if ( $is_individual ) { + global $pagenow; + + if ( $pagenow === 'post-new.php' || $is_individual ) { ?>
| + + + | - +
|---|