Add fallback for offense and defense stats

This commit is contained in:
Brian Miyaji
2016-02-17 19:46:39 +11:00
parent df1eaf9ad7
commit fd3f72d8c3
3 changed files with 68 additions and 36 deletions

View File

@@ -832,7 +832,11 @@ if ( !function_exists( 'sp_post_checklist' ) ) {
<ul class="categorychecklist form-no-clear">
<li class="sp-select-all-container"><label class="selectit"><input type="checkbox" class="sp-select-all"> <strong><?php _e( 'Select All', 'sportspress' ); ?></strong></label></li>
<?php
$selected = sp_array_between( (array)get_post_meta( $post_id, $meta, false ), 0, $index );
$selected = (array)get_post_meta( $post_id, $slug, false );
if ( ! sizeof( $selected ) ) {
$selected = (array)get_post_meta( $post_id, $meta, false );
}
$selected = sp_array_between( $selected, 0, $index );
if ( empty( $posts ) ):
$query = array( 'post_type' => $meta, 'numberposts' => -1, 'post_per_page' => -1, 'orderby' => 'menu_order' );
if ( $meta == 'sp_player' ):