Change Leagues (sp_league) to Seasons (sp_season)
This commit is contained in:
@@ -39,7 +39,11 @@ function sp_column_details_meta( $post ) {
|
||||
$equation = explode( ' ', get_post_meta( $post->ID, 'sp_equation', true ) );
|
||||
$order = get_post_meta( $post->ID, 'sp_order', true );
|
||||
$priority = get_post_meta( $post->ID, 'sp_priority', true );
|
||||
$precision = get_post_meta( $post->ID, 'sp_precision', true );
|
||||
$abbreviation = get_post_meta( $post->ID, 'sp_abbreviation', true );
|
||||
|
||||
// Defaults
|
||||
if ( $precision == '' ) $precision = 1;
|
||||
?>
|
||||
<p><strong><?php _e( 'Equation', 'sportspress' ); ?></strong></p>
|
||||
<p class="sp-equation-selector">
|
||||
@@ -68,6 +72,10 @@ function sp_column_details_meta( $post ) {
|
||||
?>
|
||||
</select>
|
||||
</p>
|
||||
<p><strong><?php _e( 'Precision', 'sportspress' ); ?></strong></p>
|
||||
<p>
|
||||
<input name="sp_precision" type="text" size="4" id="sp_precision" value="<?php echo $precision; ?>">
|
||||
</p>
|
||||
<p><strong><?php _e( 'Abbreviation', 'sportspress' ); ?></strong></p>
|
||||
<p>
|
||||
<input name="sp_abbreviation" type="text" size="4" id="sp_abbreviation" value="<?php echo $abbreviation; ?>">
|
||||
|
||||
@@ -141,7 +141,7 @@ function sp_event_edit_columns() {
|
||||
'cb' => '<input type="checkbox" />',
|
||||
'title' => __( 'Event', 'sportspress' ),
|
||||
'sp_team' => __( 'Teams', 'sportspress' ),
|
||||
'sp_league' => __( 'Leagues', 'sportspress' ),
|
||||
'sp_season' => __( 'Seasons', 'sportspress' ),
|
||||
'sp_kickoff' => __( 'Kick-off', 'sportspress' )
|
||||
);
|
||||
return $columns;
|
||||
|
||||
@@ -25,7 +25,7 @@ function sp_list_edit_columns() {
|
||||
'title' => __( 'Title' ),
|
||||
'sp_player' => __( 'Players', 'sportspress' ),
|
||||
'sp_team' => __( 'Teams', 'sportspress' ),
|
||||
'sp_league' => __( 'Leagues', 'sportspress' )
|
||||
'sp_season' => __( 'Seasons', 'sportspress' )
|
||||
);
|
||||
return $columns;
|
||||
}
|
||||
@@ -42,16 +42,16 @@ function sp_list_meta_init( $post ) {
|
||||
}
|
||||
|
||||
function sp_list_player_meta( $post ) {
|
||||
$league_id = sp_get_the_term_id( $post->ID, 'sp_league', 0 );
|
||||
$season_id = sp_get_the_term_id( $post->ID, 'sp_season', 0 );
|
||||
$team_id = get_post_meta( $post->ID, 'sp_team', true );
|
||||
?>
|
||||
<div>
|
||||
<p class="sp-tab-select">
|
||||
<?php
|
||||
$args = array(
|
||||
'taxonomy' => 'sp_league',
|
||||
'name' => 'sp_league',
|
||||
'selected' => $league_id,
|
||||
'taxonomy' => 'sp_season',
|
||||
'name' => 'sp_season',
|
||||
'selected' => $season_id,
|
||||
'value' => 'term_id'
|
||||
);
|
||||
sp_dropdown_taxonomies( $args );
|
||||
|
||||
@@ -21,7 +21,7 @@ add_action( 'init', 'sp_player_cpt_init' );
|
||||
|
||||
function sp_player_meta_init( $post ) {
|
||||
$teams = (array)get_post_meta( $post->ID, 'sp_team', false );
|
||||
$leagues = (array)get_the_terms( $post->ID, 'sp_league' );
|
||||
$leagues = (array)get_the_terms( $post->ID, 'sp_season' );
|
||||
|
||||
remove_meta_box( 'submitdiv', 'sp_player', 'side' );
|
||||
add_meta_box( 'submitdiv', __( 'Publish' ), 'post_submit_meta_box', 'sp_player', 'side', 'high' );
|
||||
@@ -44,7 +44,7 @@ function sp_player_team_meta( $post ) {
|
||||
|
||||
function sp_player_stats_meta( $post ) {
|
||||
$team_ids = (array)get_post_meta( $post->ID, 'sp_team', false );
|
||||
$leagues = (array)get_the_terms( $post->ID, 'sp_league' );
|
||||
$leagues = (array)get_the_terms( $post->ID, 'sp_season' );
|
||||
$stats = (array)get_post_meta( $post->ID, 'sp_statistics', true );
|
||||
|
||||
// Equation Operating System
|
||||
@@ -110,7 +110,7 @@ function sp_player_stats_meta( $post ) {
|
||||
),
|
||||
'tax_query' => array(
|
||||
array(
|
||||
'taxonomy' => 'sp_league',
|
||||
'taxonomy' => 'sp_season',
|
||||
'field' => 'id',
|
||||
'terms' => $div_id
|
||||
)
|
||||
@@ -182,7 +182,7 @@ function sp_player_edit_columns() {
|
||||
'title' => __( 'Name', 'sportspress' ),
|
||||
'sp_position' => __( 'Positions', 'sportspress' ),
|
||||
'sp_team' => __( 'Teams', 'sportspress' ),
|
||||
'sp_league' => __( 'Leagues', 'sportspress' )
|
||||
'sp_season' => __( 'Seasons', 'sportspress' )
|
||||
);
|
||||
return $columns;
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ function sp_staff_edit_columns() {
|
||||
'title' => __( 'Name', 'sportspress' ),
|
||||
'sp_position' => __( 'Positions', 'sportspress' ),
|
||||
'sp_team' => __( 'Teams', 'sportspress' ),
|
||||
'sp_league' => __( 'Leagues', 'sportspress' ),
|
||||
'sp_season' => __( 'Seasons', 'sportspress' ),
|
||||
);
|
||||
return $columns;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,13 @@ function sp_statistic_meta_init() {
|
||||
|
||||
function sp_statistic_equation_meta( $post ) {
|
||||
$equation = explode( ' ', get_post_meta( $post->ID, 'sp_equation', true ) );
|
||||
$order = get_post_meta( $post->ID, 'sp_order', true );
|
||||
$priority = get_post_meta( $post->ID, 'sp_priority', true );
|
||||
$precision = get_post_meta( $post->ID, 'sp_precision', true );
|
||||
$abbreviation = get_post_meta( $post->ID, 'sp_abbreviation', true );
|
||||
|
||||
// Defaults
|
||||
if ( $precision == '' ) $precision = 1;
|
||||
?>
|
||||
<p class="sp-equation-selector">
|
||||
<?php
|
||||
@@ -46,6 +52,28 @@ function sp_statistic_equation_meta( $post ) {
|
||||
endforeach;
|
||||
?>
|
||||
</p>
|
||||
<p><strong><?php _e( 'Sort Order', 'sportspress' ); ?></strong></p>
|
||||
<p class="sp-order-selector">
|
||||
<select name="sp_priority">
|
||||
<?php
|
||||
$options = array( '0' => __( 'Disable', 'sportspress' ), '1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6', '7' => '7', '8' => '8', '9' => '9', '10' => '10', );
|
||||
foreach ( $options as $key => $value ):
|
||||
printf( '<option value="%s" %s>%s</option>', $key, selected( true, $key == $priority, false ), $value );
|
||||
endforeach;
|
||||
?>
|
||||
</select>
|
||||
<select name="sp_order"<?php if ( ! $priority ): ?> disabled="disabled;"<?php endif; ?>>
|
||||
<?php
|
||||
$options = array( 'DESC' => __( 'Descending', 'sportspress' ), 'ASC' => __( 'Ascending', 'sportspress' ) );
|
||||
foreach ( $options as $key => $value ):
|
||||
printf( '<option value="%s" %s>%s</option>', $key, selected( true, $key == $order, false ), $value );
|
||||
endforeach;
|
||||
?>
|
||||
</select>
|
||||
<p><strong><?php _e( 'Precision', 'sportspress' ); ?></strong></p>
|
||||
<p>
|
||||
<input name="sp_precision" type="text" size="4" id="sp_precision" value="<?php echo $precision; ?>">
|
||||
</p>
|
||||
<p><strong><?php _e( 'Abbreviation', 'sportspress' ); ?></strong></p>
|
||||
<p>
|
||||
<input name="sp_abbreviation" type="text" size="4" id="sp_abbreviation" value="<?php echo $abbreviation; ?>">
|
||||
|
||||
@@ -24,7 +24,7 @@ function sp_table_edit_columns() {
|
||||
'cb' => '<input type="checkbox" />',
|
||||
'title' => __( 'Title' ),
|
||||
'sp_team' => __( 'Teams', 'sportspress' ),
|
||||
'sp_league' => __( 'Leagues', 'sportspress' ),
|
||||
'sp_season' => __( 'Seasons', 'sportspress' ),
|
||||
);
|
||||
return $columns;
|
||||
}
|
||||
@@ -41,14 +41,14 @@ function sp_table_meta_init( $post ) {
|
||||
}
|
||||
|
||||
function sp_table_team_meta( $post, $test ) {
|
||||
$league_id = sp_get_the_term_id( $post->ID, 'sp_league', 0 );
|
||||
$league_id = sp_get_the_term_id( $post->ID, 'sp_season', 0 );
|
||||
?>
|
||||
<div>
|
||||
<p class="sp-tab-select">
|
||||
<?php
|
||||
$args = array(
|
||||
'taxonomy' => 'sp_league',
|
||||
'name' => 'sp_league',
|
||||
'taxonomy' => 'sp_season',
|
||||
'name' => 'sp_season',
|
||||
'selected' => $league_id,
|
||||
'value' => 'term_id'
|
||||
);
|
||||
@@ -56,7 +56,7 @@ function sp_table_team_meta( $post, $test ) {
|
||||
?>
|
||||
</p>
|
||||
<?php
|
||||
sp_post_checklist( $post->ID, 'sp_team', 'block', 'sp_league' );
|
||||
sp_post_checklist( $post->ID, 'sp_team', 'block', 'sp_season' );
|
||||
sp_post_adder( 'sp_team' );
|
||||
?>
|
||||
</div>
|
||||
|
||||
@@ -20,7 +20,7 @@ function sp_team_cpt_init() {
|
||||
add_action( 'init', 'sp_team_cpt_init' );
|
||||
|
||||
function sp_team_meta_init( $post ) {
|
||||
$leagues = (array)get_the_terms( $post->ID, 'sp_league' );
|
||||
$leagues = (array)get_the_terms( $post->ID, 'sp_season' );
|
||||
|
||||
remove_meta_box( 'submitdiv', 'sp_team', 'side' );
|
||||
add_meta_box( 'submitdiv', __( 'Publish' ), 'post_submit_meta_box', 'sp_team', 'side', 'high' );
|
||||
@@ -37,14 +37,14 @@ function sp_team_edit_columns() {
|
||||
'cb' => '<input type="checkbox" />',
|
||||
'sp_logo' => ' ',
|
||||
'title' => __( 'Team', 'sportspress' ),
|
||||
'sp_league' => __( 'Leagues', 'sportspress' )
|
||||
'sp_season' => __( 'Seasons', 'sportspress' )
|
||||
);
|
||||
return $columns;
|
||||
}
|
||||
add_filter( 'manage_edit-sp_team_columns', 'sp_team_edit_columns' );
|
||||
|
||||
function sp_team_columns_meta( $post ) {
|
||||
$leagues = (array)get_the_terms( $post->ID, 'sp_league' );
|
||||
$leagues = (array)get_the_terms( $post->ID, 'sp_season' );
|
||||
$columns = (array)get_post_meta( $post->ID, 'sp_columns', true );
|
||||
|
||||
// Equation Operating System
|
||||
@@ -98,7 +98,7 @@ function sp_team_columns_meta( $post ) {
|
||||
),
|
||||
'tax_query' => array(
|
||||
array(
|
||||
'taxonomy' => 'sp_league',
|
||||
'taxonomy' => 'sp_season',
|
||||
'field' => 'id',
|
||||
'terms' => $div_id
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user