All leagues and seasons option to player list

This commit is contained in:
Brian Miyaji
2014-08-23 23:26:08 +10:00
parent f3d81e0cc7
commit bb41cc6cd9
2 changed files with 20 additions and 12 deletions

View File

@@ -718,21 +718,27 @@ if ( !function_exists( 'sp_post_checklist' ) ) {
if ( is_array( $filters ) ):
$filter_values = array();
foreach ( $filters as $filter ):
$filter_values = array_merge( $filter_values, (array)get_post_meta( $post->ID, $filter, false ) );
if ( get_taxonomy( $filter ) ):
$terms = (array)get_the_terms( $post->ID, $filter );
foreach ( $terms as $term ):
if ( is_object( $term ) && property_exists( $term, 'term_id' ) )
$filter_values[] = $term->term_id;
endforeach;
else:
$filter_values = array_merge( $filter_values, (array)get_post_meta( $post->ID, $filter, false ) );
endif;
endforeach;
else:
$filter = $filters;
if ( get_taxonomy( $filter ) ):
$terms = (array)get_the_terms( $post->ID, $filter );
foreach ( $terms as $term ):
if ( is_object( $term ) && property_exists( $term, 'term_id' ) )
$filter_values[] = $term->term_id;
endforeach;
endforeach;
else:
$filter = $filters;
$filter_values = (array)get_post_meta( $post->ID, $filter, false );
$terms = (array)get_the_terms( $post->ID, $filter );
foreach ( $terms as $term ):
if ( is_object( $term ) && property_exists( $term, 'term_id' ) )
$filter_values[] = $term->term_id;
endforeach;
else:
$filter_values = (array)get_post_meta( $post->ID, $filter, false );
endif;
endif;
endif;
?>