Change div to league and pos to position
This commit is contained in:
@@ -243,7 +243,7 @@ if ( !function_exists( 'sp_post_checklist' ) ) {
|
||||
$parents = get_post_ancestors( $post );
|
||||
if ( $filter ):
|
||||
$filter_values = (array)get_post_meta( $post->ID, $filter, false );
|
||||
$terms = (array)get_the_terms( $post->ID, 'sp_div' );
|
||||
$terms = (array)get_the_terms( $post->ID, 'sp_league' );
|
||||
foreach ( $terms as $term ):
|
||||
if ( is_object( $term ) && property_exists( $term, 'term_id' ) )
|
||||
$filter_values[] = $term->term_id;
|
||||
@@ -457,7 +457,7 @@ if ( !function_exists( 'sp_league_table' ) ) {
|
||||
$i = 0;
|
||||
foreach ( $data as $team_id => $team_stats ):
|
||||
if ( !$team_id ) continue;
|
||||
$div = get_term( $team_id, 'sp_div' );
|
||||
$div = get_term( $team_id, 'sp_league' );
|
||||
?>
|
||||
<tr class="sp-row sp-post<?php if ( $i % 2 == 0 ) echo ' alternate'; ?>">
|
||||
<td>
|
||||
@@ -497,7 +497,7 @@ if ( !function_exists( 'sp_player_table' ) ) {
|
||||
$i = 0;
|
||||
foreach ( $data as $player_id => $player_stats ):
|
||||
if ( !$player_id ) continue;
|
||||
$div = get_term( $player_id, 'sp_div' );
|
||||
$div = get_term( $player_id, 'sp_league' );
|
||||
?>
|
||||
<tr class="sp-row sp-post<?php if ( $i % 2 == 0 ) echo ' alternate'; ?>">
|
||||
<td>
|
||||
@@ -526,7 +526,7 @@ if ( !function_exists( 'sp_team_stats_table' ) ) {
|
||||
<table class="widefat sp-data-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php _e( 'Division', 'sportspress' ); ?></th>
|
||||
<th><?php _e( 'League', 'sportspress' ); ?></th>
|
||||
<?php foreach ( $columns as $label ): ?>
|
||||
<th><?php echo $label; ?></th>
|
||||
<?php endforeach; ?>
|
||||
@@ -538,13 +538,13 @@ if ( !function_exists( 'sp_team_stats_table' ) ) {
|
||||
if ( empty( $data ) ):
|
||||
?>
|
||||
<tr class="sp-row sp-post<?php if ( $i % 2 == 0 ) echo ' alternate'; ?>">
|
||||
<td><strong><?php printf( __( 'Select %s', 'sportspress' ), __( 'Division', 'sportspress' ) ); ?></strong></td>
|
||||
<td><strong><?php printf( __( 'Select %s', 'sportspress' ), __( 'League', 'sportspress' ) ); ?></strong></td>
|
||||
</tr>
|
||||
<?php
|
||||
else:
|
||||
foreach ( $data as $div_id => $div_stats ):
|
||||
if ( !$div_id ) continue;
|
||||
$div = get_term( $div_id, 'sp_div' );
|
||||
$div = get_term( $div_id, 'sp_league' );
|
||||
?>
|
||||
<tr class="sp-row sp-post<?php if ( $i % 2 == 0 ) echo ' alternate'; ?>">
|
||||
<td>
|
||||
@@ -574,7 +574,7 @@ if ( !function_exists( 'sp_player_metrics_table' ) ) {
|
||||
<table class="widefat sp-data-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?php _e( 'Division', 'sportspress' ); ?></th>
|
||||
<th><?php _e( 'League', 'sportspress' ); ?></th>
|
||||
<?php foreach ( $columns as $label ): ?>
|
||||
<th><?php echo $label; ?></th>
|
||||
<?php endforeach; ?>
|
||||
@@ -592,7 +592,7 @@ if ( !function_exists( 'sp_player_metrics_table' ) ) {
|
||||
endif;
|
||||
foreach ( $team_stats as $div_id => $div_stats ):
|
||||
if ( !$div_id ) continue;
|
||||
$div = get_term( $div_id, 'sp_div' );
|
||||
$div = get_term( $div_id, 'sp_league' );
|
||||
?>
|
||||
<tr class="sp-row sp-post<?php if ( $i % 2 == 0 ) echo ' alternate'; ?>">
|
||||
<td>
|
||||
@@ -777,7 +777,7 @@ if ( !function_exists( 'sportspress_render_option_field' ) ) {
|
||||
|
||||
if ( !function_exists( 'sp_get_table' ) ) {
|
||||
function sp_get_table( $post_id, $breakdown = false ) {
|
||||
$div_id = sp_get_the_term_id( $post_id, 'sp_div', 0 );
|
||||
$div_id = sp_get_the_term_id( $post_id, 'sp_league', 0 );
|
||||
$team_ids = (array)get_post_meta( $post_id, 'sp_team', false );
|
||||
$table_stats = (array)get_post_meta( $post_id, 'sp_teams', true );
|
||||
|
||||
@@ -790,7 +790,7 @@ if ( !function_exists( 'sp_get_table' ) ) {
|
||||
// Get labels from outcome variables
|
||||
$outcome_labels = (array)sp_get_var_labels( 'sp_outcome' );
|
||||
|
||||
// Get all divisions populated with stats where available
|
||||
// Get all leagues populated with stats where available
|
||||
$tempdata = sp_array_combine( $team_ids, $table_stats );
|
||||
|
||||
// Create entry for each team in totals
|
||||
@@ -831,7 +831,7 @@ if ( !function_exists( 'sp_get_table' ) ) {
|
||||
'posts_per_page' => -1,
|
||||
'tax_query' => array(
|
||||
array(
|
||||
'taxonomy' => 'sp_div',
|
||||
'taxonomy' => 'sp_league',
|
||||
'field' => 'id',
|
||||
'terms' => $div_id
|
||||
)
|
||||
@@ -978,7 +978,7 @@ if ( !function_exists( 'sp_get_table' ) ) {
|
||||
|
||||
if ( !function_exists( 'sp_get_list' ) ) {
|
||||
function sp_get_list( $post_id, $breakdown = false ) {
|
||||
$div_id = sp_get_the_term_id( $post_id, 'sp_div', 0 );
|
||||
$div_id = sp_get_the_term_id( $post_id, 'sp_league', 0 );
|
||||
$team_id = get_post_meta( $post_id, 'sp_team', true );
|
||||
$player_ids = (array)get_post_meta( $post_id, 'sp_player', false );
|
||||
$stats = (array)get_post_meta( $post_id, 'sp_players', true );
|
||||
@@ -989,7 +989,7 @@ if ( !function_exists( 'sp_get_list' ) ) {
|
||||
// Get labels from result variables
|
||||
$columns = (array)sp_get_var_labels( 'sp_metric' );
|
||||
|
||||
// Get all divisions populated with stats where available
|
||||
// Get all leagues populated with stats where available
|
||||
$tempdata = sp_array_combine( $player_ids, $stats );
|
||||
|
||||
// Get equations from statistics variables
|
||||
@@ -1027,7 +1027,7 @@ if ( !function_exists( 'sp_get_list' ) ) {
|
||||
'posts_per_page' => -1,
|
||||
'tax_query' => array(
|
||||
array(
|
||||
'taxonomy' => 'sp_div',
|
||||
'taxonomy' => 'sp_league',
|
||||
'field' => 'id',
|
||||
'terms' => $div_id
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user