Display player metrics for position only
This commit is contained in:
@@ -138,6 +138,7 @@ function sportspress_player_stats_meta( $post ) {
|
|||||||
|
|
||||||
function sportspress_player_metrics_meta( $post ) {
|
function sportspress_player_metrics_meta( $post ) {
|
||||||
$metrics = get_post_meta( $post->ID, 'sp_metrics', true );
|
$metrics = get_post_meta( $post->ID, 'sp_metrics', true );
|
||||||
|
$positions = get_the_terms( $post->ID, 'sp_position' );
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<div class="sp-data-table-container">
|
<div class="sp-data-table-container">
|
||||||
@@ -159,6 +160,20 @@ function sportspress_player_metrics_meta( $post ) {
|
|||||||
'order' => 'ASC',
|
'order' => 'ASC',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if ( $positions ):
|
||||||
|
$position_ids = array();
|
||||||
|
foreach( $positions as $position ):
|
||||||
|
$position_ids[] = $position->term_id;
|
||||||
|
endforeach;
|
||||||
|
$args['tax_query'] = array(
|
||||||
|
array(
|
||||||
|
'taxonomy' => 'sp_position',
|
||||||
|
'field' => 'id',
|
||||||
|
'terms' => $position_ids,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
endif;
|
||||||
|
|
||||||
$vars = get_posts( $args );
|
$vars = get_posts( $args );
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user