sprintf( __( 'All %s', 'sportspress' ), __( 'Leagues', 'sportspress' ) ), - 'taxonomy' => 'sp_league', - 'name' => 'sp_league', - 'selected' => $league_id + 'show_option_all' => sprintf( __( 'All %s', 'sportspress' ), __( 'Divisions', 'sportspress' ) ), + 'taxonomy' => 'sp_division', + 'name' => 'sp_division', + 'selected' => $division_id ); sp_dropdown_taxonomies( $args ); ?> @@ -75,9 +75,9 @@ 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 ); - $league_id = sp_get_the_term_id( $post->ID, 'sp_league', 0 ); + $division_id = sp_get_the_term_id( $post->ID, 'sp_division', 0 ); $team_id = get_post_meta( $post->ID, 'sp_team', true ); - $data = sp_array_combine( $players, sp_array_value( $stats, $league_id, array() ) ); + $data = sp_array_combine( $players, sp_array_value( $stats, $division_id, array() ) ); // Generate array of placeholder values for each player $placeholders = array(); @@ -92,9 +92,9 @@ function sp_list_stats_meta( $post ) { ), 'tax_query' => array( array( - 'taxonomy' => 'sp_league', + 'taxonomy' => 'sp_division', 'field' => 'id', - 'terms' => $league_id + 'terms' => $division_id ) ) ); @@ -108,6 +108,6 @@ function sp_list_stats_meta( $post ) { // Add first column label array_unshift( $columns, __( 'Player', 'sportspress' ) ); - sp_stats_table( $data, $placeholders, $league_id, $columns, false ); + sp_stats_table( $data, $placeholders, $division_id, $columns, false ); } ?> \ No newline at end of file diff --git a/player.php b/player.php index 5fe9f714..7702176c 100644 --- a/player.php +++ b/player.php @@ -35,7 +35,7 @@ function sp_player_team_meta( $post ) { function sp_player_stats_meta( $post ) { $teams = (array)get_post_meta( $post->ID, 'sp_team', false ); - $leagues = (array)get_the_terms( $post->ID, 'sp_league' ); + $divisions = (array)get_the_terms( $post->ID, 'sp_division' ); $stats = (array)get_post_meta( $post->ID, 'sp_stats', true ); // Get column names from settings @@ -43,21 +43,21 @@ function sp_player_stats_meta( $post ) { $columns = sp_get_eos_keys( $stats_settings['player'] ); // Add first column label - array_unshift( $columns, __( 'League', 'sportspress' ) ); + array_unshift( $columns, __( 'Division', 'sportspress' ) ); - // Generate array of all league ids - $league_ids = array( 0 ); - foreach ( $leagues as $key => $value ): + // Generate array of all division ids + $division_ids = array( 0 ); + foreach ( $divisions as $key => $value ): if ( is_object( $value ) && property_exists( $value, 'term_id' ) ) - $league_ids[] = $value->term_id; + $division_ids[] = $value->term_id; endforeach; // Get all teams populated with overall stats where availabled - $data = sp_array_combine( $league_ids, sp_array_value( $stats, 0, array() ) ); + $data = sp_array_combine( $division_ids, sp_array_value( $stats, 0, array() ) ); - // Generate array of placeholder values for each league + // Generate array of placeholder values for each division $placeholders = array(); - foreach ( $league_ids as $league_id ): + foreach ( $division_ids as $division_id ): $args = array( 'post_type' => 'sp_event', 'meta_query' => array( @@ -67,33 +67,33 @@ function sp_player_stats_meta( $post ) { ) ) ); - if ( $league_id ): + if ( $division_id ): $args['tax_query'] = array( array( - 'taxonomy' => 'sp_league', + 'taxonomy' => 'sp_division', 'field' => 'id', - 'terms' => $league_id + 'terms' => $division_id ) ); endif; - $placeholders[ $league_id ] = sp_get_stats_row( 'sp_player', $args ); + $placeholders[ $division_id ] = sp_get_stats_row( 'sp_player', $args ); endforeach; ?>
'sp_event', 'meta_query' => array( @@ -108,19 +108,19 @@ function sp_player_stats_meta( $post ) { ), 'tax_query' => array( array( - 'taxonomy' => 'sp_league', + 'taxonomy' => 'sp_division', 'field' => 'id', - 'terms' => $league_id + 'terms' => $division_id ) ) ); - $placeholders[ $league_id ] = sp_get_stats_row( 'sp_player', $args ); + $placeholders[ $division_id ] = sp_get_stats_row( 'sp_player', $args ); endforeach; ?>
__( 'Name', 'sportspress' ), 'sp_position' => __( 'Positions', 'sportspress' ), 'sp_team' => __( 'Teams', 'sportspress' ), - 'sp_league' => __( 'Leagues', 'sportspress' ), - 'sp_sponsor' => __( 'Sponsors', 'sportspress' ) + 'sp_division' => __( 'Divisions', 'sportspress' ) ); return $columns; } diff --git a/readme.txt b/readme.txt index 6f40b672..95dc8e01 100644 --- a/readme.txt +++ b/readme.txt @@ -1,6 +1,6 @@ === SportsPress - flexible sports management === Contributors: themeboy -Tags: sports, sports journalism, teams, team management, fixtures, results, standings, league table, leagues, reporting, themeboy, wordpress sports, configurable, variable, widgets +Tags: sports, sports journalism, teams, team management, fixtures, results, standings, league tables, divisions, reporting, themeboy, wordpress sports, configurable, variable, widgets Requires at least: 3.5 Tested up to: 3.6 Stable tag: 1.0 diff --git a/sponsor.php b/sponsor.php deleted file mode 100644 index e68dfee9..00000000 --- a/sponsor.php +++ /dev/null @@ -1,18 +0,0 @@ - $name, - 'labels' => $labels, - 'public' => true, - 'hierarchical' => true, - 'rewrite' => array( 'slug' => 'sponsor' ), - ); - register_taxonomy( 'sp_sponsor', $object_type, $args ); -} -add_action( 'init', 'sp_sponsor_tax_init' ); -?> \ No newline at end of file diff --git a/sportspress.php b/sportspress.php index 601ae844..0b4367f8 100644 --- a/sportspress.php +++ b/sportspress.php @@ -42,9 +42,8 @@ require_once dirname( __FILE__ ) . '/table.php'; require_once dirname( __FILE__ ) . '/list.php'; // Taxonomies -require_once dirname( __FILE__ ) . '/league.php'; +require_once dirname( __FILE__ ) . '/division.php'; require_once dirname( __FILE__ ) . '/position.php'; -require_once dirname( __FILE__ ) . '/sponsor.php'; // Styles include_once dirname( __FILE__ ) . '/styles.php' ; diff --git a/staff.php b/staff.php index 32e06f3d..b9955a60 100644 --- a/staff.php +++ b/staff.php @@ -41,7 +41,7 @@ function sp_staff_edit_columns() { 'title' => __( 'Name', 'sportspress' ), 'sp_position' => __( 'Positions', 'sportspress' ), 'sp_team' => __( 'Teams', 'sportspress' ), - 'sp_league' => __( 'Leagues', 'sportspress' ), + 'sp_division' => __( 'Divisions', 'sportspress' ), ); return $columns; } diff --git a/table.php b/table.php index 24f2103b..cfd10676 100644 --- a/table.php +++ b/table.php @@ -23,7 +23,7 @@ function sp_table_edit_columns() { 'cb' => '', 'title' => __( 'Title' ), 'sp_team' => __( 'Teams', 'sportspress' ), - 'sp_league' => __( 'Leagues', 'sportspress' ), + 'sp_division' => __( 'Divisions', 'sportspress' ), ); return $columns; } @@ -35,22 +35,22 @@ function sp_table_meta_init() { } function sp_table_team_meta( $post ) { - $league_id = sp_get_the_term_id( $post->ID, 'sp_league', 0 ); + $division_id = sp_get_the_term_id( $post->ID, 'sp_division', 0 ); ?>
sprintf( __( 'All %s', 'sportspress' ), __( 'Leagues', 'sportspress' ) ), - 'taxonomy' => 'sp_league', - 'name' => 'sp_league', - 'selected' => $league_id + 'show_option_all' => sprintf( __( 'All %s', 'sportspress' ), __( 'Divisions', 'sportspress' ) ), + 'taxonomy' => 'sp_division', + 'name' => 'sp_division', + 'selected' => $division_id ); sp_dropdown_taxonomies( $args ); ?>
ID, 'sp_team', 'block', 'sp_league' ); + sp_post_checklist( $post->ID, 'sp_team', 'block', 'sp_division' ); sp_post_adder( 'sp_team' ); ?>