Finalize term names and add divider
This commit is contained in:
12
list.php
12
list.php
@@ -24,7 +24,7 @@ function sp_list_edit_columns() {
|
||||
'title' => __( 'Title' ),
|
||||
'sp_player' => __( 'Players', 'sportspress' ),
|
||||
'sp_team' => __( 'Teams', 'sportspress' ),
|
||||
'sp_division' => __( 'Divisions', 'sportspress' )
|
||||
'sp_div' => __( 'Divisions', 'sportspress' )
|
||||
);
|
||||
return $columns;
|
||||
}
|
||||
@@ -36,7 +36,7 @@ function sp_list_meta_init() {
|
||||
}
|
||||
|
||||
function sp_list_player_meta( $post ) {
|
||||
$division_id = sp_get_the_term_id( $post->ID, 'sp_division', 0 );
|
||||
$division_id = sp_get_the_term_id( $post->ID, 'sp_div', 0 );
|
||||
$team_id = get_post_meta( $post->ID, 'sp_team', true );
|
||||
?>
|
||||
<div>
|
||||
@@ -44,8 +44,8 @@ function sp_list_player_meta( $post ) {
|
||||
<?php
|
||||
$args = array(
|
||||
'show_option_all' => sprintf( __( 'All %s', 'sportspress' ), __( 'Divisions', 'sportspress' ) ),
|
||||
'taxonomy' => 'sp_division',
|
||||
'name' => 'sp_division',
|
||||
'taxonomy' => 'sp_div',
|
||||
'name' => 'sp_div',
|
||||
'selected' => $division_id
|
||||
);
|
||||
sp_dropdown_taxonomies( $args );
|
||||
@@ -75,7 +75,7 @@ function sp_list_player_meta( $post ) {
|
||||
function sp_list_stats_meta( $post ) {
|
||||
$players = (array)get_post_meta( $post->ID, 'sp_player', false );
|
||||
$stats = (array)get_post_meta( $post->ID, 'sp_stats', true );
|
||||
$division_id = sp_get_the_term_id( $post->ID, 'sp_division', 0 );
|
||||
$division_id = sp_get_the_term_id( $post->ID, 'sp_div', 0 );
|
||||
$team_id = get_post_meta( $post->ID, 'sp_team', true );
|
||||
$data = sp_array_combine( $players, sp_array_value( $stats, $division_id, array() ) );
|
||||
|
||||
@@ -92,7 +92,7 @@ function sp_list_stats_meta( $post ) {
|
||||
),
|
||||
'tax_query' => array(
|
||||
array(
|
||||
'taxonomy' => 'sp_division',
|
||||
'taxonomy' => 'sp_div',
|
||||
'field' => 'id',
|
||||
'terms' => $division_id
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user