Rename competitions to leagues
This commit is contained in:
@@ -58,7 +58,7 @@ class SP_Admin_Menus {
|
||||
* Add menu item
|
||||
*/
|
||||
public function leagues_menu() {
|
||||
add_submenu_page( 'sportspress', __( 'Competitions', 'sportspress' ), __( 'Competitions', 'sportspress' ), 'manage_sportspress', 'edit-tags.php?taxonomy=sp_league');
|
||||
add_submenu_page( 'sportspress', __( 'Leagues', 'sportspress' ), __( 'Leagues', 'sportspress' ), 'manage_sportspress', 'edit-tags.php?taxonomy=sp_league');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -195,26 +195,26 @@ class SP_Admin_Menus {
|
||||
$menu[ $separator_position ] = array( '', 'read', 'separator-sportspress', '', 'wp-menu-separator sportspress' );
|
||||
endif;
|
||||
|
||||
// Remove "Competitions" and "Seasons" links from Events submenu
|
||||
// Remove "Leagues" and "Seasons" links from Events submenu
|
||||
if ( isset( $submenu['edit.php?post_type=sp_event'] ) ):
|
||||
$submenu['edit.php?post_type=sp_event'] = array_filter( $submenu['edit.php?post_type=sp_event'], array( $this, 'remove_leagues' ) );
|
||||
$submenu['edit.php?post_type=sp_event'] = array_filter( $submenu['edit.php?post_type=sp_event'], array( $this, 'remove_seasons' ) );
|
||||
endif;
|
||||
|
||||
// Remove "Venues", "Competitions" and "Seasons" links from Teams submenu
|
||||
// Remove "Venues", "Leagues" and "Seasons" links from Teams submenu
|
||||
if ( isset( $submenu['edit.php?post_type=sp_team'] ) ):
|
||||
$submenu['edit.php?post_type=sp_team'] = array_filter( $submenu['edit.php?post_type=sp_team'], array( $this, 'remove_venues' ) );
|
||||
$submenu['edit.php?post_type=sp_team'] = array_filter( $submenu['edit.php?post_type=sp_team'], array( $this, 'remove_leagues' ) );
|
||||
$submenu['edit.php?post_type=sp_team'] = array_filter( $submenu['edit.php?post_type=sp_team'], array( $this, 'remove_seasons' ) );
|
||||
endif;
|
||||
|
||||
// Remove "Competitions" and "Seasons" links from Players submenu
|
||||
// Remove "Leagues" and "Seasons" links from Players submenu
|
||||
if ( isset( $submenu['edit.php?post_type=sp_player'] ) ):
|
||||
$submenu['edit.php?post_type=sp_player'] = array_filter( $submenu['edit.php?post_type=sp_player'], array( $this, 'remove_leagues' ) );
|
||||
$submenu['edit.php?post_type=sp_player'] = array_filter( $submenu['edit.php?post_type=sp_player'], array( $this, 'remove_seasons' ) );
|
||||
endif;
|
||||
|
||||
// Remove "Competitions" and "Seasons" links from Staff submenu
|
||||
// Remove "Leagues" and "Seasons" links from Staff submenu
|
||||
if ( isset( $submenu['edit.php?post_type=sp_staff'] ) ):
|
||||
$submenu['edit.php?post_type=sp_staff'] = array_filter( $submenu['edit.php?post_type=sp_staff'], array( $this, 'remove_leagues' ) );
|
||||
$submenu['edit.php?post_type=sp_staff'] = array_filter( $submenu['edit.php?post_type=sp_staff'], array( $this, 'remove_seasons' ) );
|
||||
@@ -250,7 +250,7 @@ class SP_Admin_Menus {
|
||||
}
|
||||
|
||||
public function remove_leagues( $arr = array() ) {
|
||||
return $arr[0] != __( 'Competitions', 'sportspress' );
|
||||
return $arr[0] != __( 'Leagues', 'sportspress' );
|
||||
}
|
||||
|
||||
public function remove_positions( $arr = array() ) {
|
||||
|
||||
@@ -26,7 +26,7 @@ class SP_Admin_Permalink_Settings {
|
||||
array( 'venue', __( 'Venues', 'sportspress' ) ),
|
||||
array( 'calendar', __( 'Calendars', 'sportspress' ) ),
|
||||
array( 'team', __( 'Teams', 'sportspress' ) ),
|
||||
array( 'league', __( 'Competitions', 'sportspress' ) ),
|
||||
array( 'league', __( 'Leagues', 'sportspress' ) ),
|
||||
array( 'season', __( 'Seasons', 'sportspress' ) ),
|
||||
array( 'table', __( 'League Tables', 'sportspress' ) ),
|
||||
array( 'player', __( 'Players', 'sportspress' ) ),
|
||||
|
||||
@@ -40,7 +40,7 @@ class SP_Admin_Sample_Data {
|
||||
// Terms to insert
|
||||
$taxonomies = array();
|
||||
|
||||
// Competitions
|
||||
// Leagues
|
||||
$taxonomies['sp_league'] = array( _x( 'Primary League', 'example', 'sportspress' ), _x( 'Secondary League', 'example', 'sportspress' ) );
|
||||
|
||||
// Seasons
|
||||
|
||||
@@ -280,7 +280,7 @@ class SP_Admin_Setup_Wizard {
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?php _e( 'Main Competition', 'sportspress' ); ?> <i class="dashicons dashicons-editor-help sp-desc-tip" title="<?php _e( 'The name of a league or division.', 'sportspress' ); ?>"></i></th>
|
||||
<th scope="row"><?php _e( 'Main League', 'sportspress' ); ?> <i class="dashicons dashicons-editor-help sp-desc-tip" title="<?php _e( 'The name of a league or division.', 'sportspress' ); ?>"></i></th>
|
||||
<td>
|
||||
<input name="league" type="text" class="widefat" value="<?php _ex( 'Primary League', 'example', 'sportspress' ); ?>">
|
||||
</td>
|
||||
|
||||
@@ -479,7 +479,7 @@ if ( class_exists( 'WP_Importer' ) ) {
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label><?php _e( 'Competition', 'sportspress' ); ?></label><br/></th>
|
||||
<th scope="row"><label><?php _e( 'League', 'sportspress' ); ?></label><br/></th>
|
||||
<td><?php
|
||||
$args = array(
|
||||
'taxonomy' => 'sp_league',
|
||||
|
||||
@@ -287,7 +287,7 @@ if ( class_exists( 'WP_Importer' ) ) {
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label><?php _e( 'Competition', 'sportspress' ); ?></label><br/></th>
|
||||
<th scope="row"><label><?php _e( 'League', 'sportspress' ); ?></label><br/></th>
|
||||
<td><?php
|
||||
$args = array(
|
||||
'taxonomy' => 'sp_league',
|
||||
|
||||
@@ -27,7 +27,7 @@ if ( class_exists( 'WP_Importer' ) ) {
|
||||
'post_title' => __( 'Name', 'sportspress' ),
|
||||
'sp_position' => __( 'Positions', 'sportspress' ),
|
||||
'sp_team' => __( 'Teams', 'sportspress' ),
|
||||
'sp_league' => __( 'Competitions', 'sportspress' ),
|
||||
'sp_league' => __( 'Leagues', 'sportspress' ),
|
||||
'sp_season' => __( 'Seasons', 'sportspress' ),
|
||||
'sp_nationality' => __( 'Nationality', 'sportspress' ),
|
||||
);
|
||||
|
||||
@@ -26,7 +26,7 @@ if ( class_exists( 'WP_Importer' ) ) {
|
||||
'post_title' => __( 'Name', 'sportspress' ),
|
||||
'sp_role' => __( 'Jobs', 'sportspress' ),
|
||||
'sp_team' => __( 'Teams', 'sportspress' ),
|
||||
'sp_league' => __( 'Competitions', 'sportspress' ),
|
||||
'sp_league' => __( 'Leagues', 'sportspress' ),
|
||||
'sp_season' => __( 'Seasons', 'sportspress' ),
|
||||
'sp_nationality' => __( 'Nationality', 'sportspress' ),
|
||||
);
|
||||
|
||||
@@ -24,7 +24,7 @@ if ( class_exists( 'WP_Importer' ) ) {
|
||||
$this->import_label = __( 'Import Teams', 'sportspress' );
|
||||
$this->columns = array(
|
||||
'post_title' => __( 'Name', 'sportspress' ),
|
||||
'sp_league' => __( 'Competitions', 'sportspress' ),
|
||||
'sp_league' => __( 'Leagues', 'sportspress' ),
|
||||
'sp_season' => __( 'Seasons', 'sportspress' ),
|
||||
'sp_url' => __( 'Site URL', 'sportspress' ),
|
||||
'sp_abbreviation' => __( 'Abbreviation', 'sportspress' ),
|
||||
|
||||
@@ -46,7 +46,7 @@ class SP_Admin_CPT_Calendar extends SP_Admin_CPT {
|
||||
$columns = array_merge( array(
|
||||
'cb' => '<input type="checkbox" />',
|
||||
'title' => __( 'Title', 'sportspress' ),
|
||||
'sp_league' => __( 'Competition', 'sportspress' ),
|
||||
'sp_league' => __( 'League', 'sportspress' ),
|
||||
'sp_season' => __( 'Season', 'sportspress' ),
|
||||
'sp_venue' => __( 'Venue', 'sportspress' ),
|
||||
'sp_team' => __( 'Team', 'sportspress' ),
|
||||
|
||||
@@ -119,7 +119,7 @@ class SP_Admin_CPT_Event extends SP_Admin_CPT {
|
||||
'date' => __( 'Date', 'sportspress' ),
|
||||
'sp_time' => __( 'Time', 'sportspress' ),
|
||||
'sp_team' => __( 'Teams', 'sportspress' ),
|
||||
'sp_league' => __( 'Competition', 'sportspress' ),
|
||||
'sp_league' => __( 'League', 'sportspress' ),
|
||||
'sp_season' => __( 'Season', 'sportspress' ),
|
||||
'sp_venue' => __( 'Venue', 'sportspress' ),
|
||||
'sp_day' => __( 'Match Day', 'sportspress' ),
|
||||
|
||||
@@ -46,7 +46,7 @@ class SP_Admin_CPT_List extends SP_Admin_CPT {
|
||||
$columns = array_merge( array(
|
||||
'cb' => '<input type="checkbox" />',
|
||||
'title' => __( 'Title', 'sportspress' ),
|
||||
'sp_league' => __( 'Competition', 'sportspress' ),
|
||||
'sp_league' => __( 'League', 'sportspress' ),
|
||||
'sp_season' => __( 'Season', 'sportspress' ),
|
||||
'sp_team' => __( 'Team', 'sportspress' ),
|
||||
'sp_player' => __( 'Players', 'sportspress' ),
|
||||
|
||||
@@ -74,7 +74,7 @@ class SP_Admin_CPT_Player extends SP_Admin_CPT {
|
||||
'title' => null,
|
||||
'sp_position' => __( 'Positions', 'sportspress' ),
|
||||
'sp_team' => __( 'Teams', 'sportspress' ),
|
||||
'sp_league' => __( 'Competitions', 'sportspress' ),
|
||||
'sp_league' => __( 'Leagues', 'sportspress' ),
|
||||
'sp_season' => __( 'Seasons', 'sportspress' ),
|
||||
), $existing_columns, array(
|
||||
'title' => __( 'Name', 'sportspress' )
|
||||
|
||||
@@ -64,7 +64,7 @@ class SP_Admin_CPT_Staff extends SP_Admin_CPT {
|
||||
'title' => null,
|
||||
'sp_role' => __( 'Job', 'sportspress' ),
|
||||
'sp_team' => __( 'Teams', 'sportspress' ),
|
||||
'sp_league' => __( 'Competitions', 'sportspress' ),
|
||||
'sp_league' => __( 'Leagues', 'sportspress' ),
|
||||
'sp_season' => __( 'Seasons', 'sportspress' ),
|
||||
), $existing_columns, array(
|
||||
'title' => __( 'Name', 'sportspress' )
|
||||
|
||||
@@ -46,7 +46,7 @@ class SP_Admin_CPT_Table extends SP_Admin_CPT {
|
||||
$columns = array_merge( array(
|
||||
'cb' => '<input type="checkbox" />',
|
||||
'title' => __( 'Title', 'sportspress' ),
|
||||
'sp_league' => __( 'Competition', 'sportspress' ),
|
||||
'sp_league' => __( 'League', 'sportspress' ),
|
||||
'sp_season' => __( 'Season', 'sportspress' ),
|
||||
'sp_team' => __( 'Teams', 'sportspress' ),
|
||||
), $existing_columns );
|
||||
|
||||
@@ -64,7 +64,7 @@ class SP_Admin_CPT_Team extends SP_Admin_CPT {
|
||||
'title' => null,
|
||||
'sp_url' => __( 'URL', 'sportspress' ),
|
||||
'sp_abbreviation' => __( 'Abbreviation', 'sportspress' ),
|
||||
'sp_league' => __( 'Competitions', 'sportspress' ),
|
||||
'sp_league' => __( 'Leagues', 'sportspress' ),
|
||||
'sp_season' => __( 'Seasons', 'sportspress' ),
|
||||
), $existing_columns, array(
|
||||
'title' => __( 'Team', 'sportspress' ),
|
||||
|
||||
@@ -47,7 +47,7 @@ class SP_Meta_Box_Calendar_Columns {
|
||||
$columns['results'] = __( 'Results', 'sportspress' );
|
||||
}
|
||||
|
||||
$columns['league'] = __( 'Competition', 'sportspress' );
|
||||
$columns['league'] = __( 'League', 'sportspress' );
|
||||
$columns['season'] = __( 'Season', 'sportspress' );
|
||||
$columns['venue'] = __( 'Venue', 'sportspress' );
|
||||
$columns['article'] = __( 'Article', 'sportspress' );
|
||||
|
||||
@@ -87,7 +87,7 @@ class SP_Meta_Box_Calendar_Data {
|
||||
<?php if ( ! is_array( $usecolumns ) || in_array( 'league', $usecolumns ) ) { ?>
|
||||
<th class="column-league">
|
||||
<label for="sp_columns_league">
|
||||
<?php _e( 'Competition', 'sportspress' ); ?>
|
||||
<?php _e( 'League', 'sportspress' ); ?>
|
||||
</label>
|
||||
</th>
|
||||
<?php } ?>
|
||||
|
||||
@@ -131,14 +131,14 @@ class SP_Meta_Box_Player_Details {
|
||||
?></p>
|
||||
|
||||
<?php if ( taxonomy_exists( 'sp_league' ) ) { ?>
|
||||
<p><strong><?php _e( 'Competitions', 'sportspress' ); ?></strong></p>
|
||||
<p><strong><?php _e( 'Leagues', 'sportspress' ); ?></strong></p>
|
||||
<p><?php
|
||||
$args = array(
|
||||
'taxonomy' => 'sp_league',
|
||||
'name' => 'tax_input[sp_league][]',
|
||||
'selected' => $league_ids,
|
||||
'values' => 'term_id',
|
||||
'placeholder' => sprintf( __( 'Select %s', 'sportspress' ), __( 'Competitions', 'sportspress' ) ),
|
||||
'placeholder' => sprintf( __( 'Select %s', 'sportspress' ), __( 'Leagues', 'sportspress' ) ),
|
||||
'class' => 'widefat',
|
||||
'property' => 'multiple',
|
||||
'chosen' => true,
|
||||
|
||||
@@ -119,14 +119,14 @@ class SP_Meta_Box_Staff_Details {
|
||||
sp_dropdown_pages( $args );
|
||||
?></p>
|
||||
|
||||
<p><strong><?php _e( 'Competitions', 'sportspress' ); ?></strong></p>
|
||||
<p><strong><?php _e( 'Leagues', 'sportspress' ); ?></strong></p>
|
||||
<p><?php
|
||||
$args = array(
|
||||
'taxonomy' => 'sp_league',
|
||||
'name' => 'tax_input[sp_league][]',
|
||||
'selected' => $league_ids,
|
||||
'values' => 'term_id',
|
||||
'placeholder' => sprintf( __( 'Select %s', 'sportspress' ), __( 'Competitions', 'sportspress' ) ),
|
||||
'placeholder' => sprintf( __( 'Select %s', 'sportspress' ), __( 'Leagues', 'sportspress' ) ),
|
||||
'class' => 'widefat',
|
||||
'property' => 'multiple',
|
||||
'chosen' => true,
|
||||
|
||||
@@ -57,14 +57,14 @@ class SP_Meta_Box_Team_Details {
|
||||
?>
|
||||
|
||||
<?php if ( taxonomy_exists( 'sp_league' ) ) { ?>
|
||||
<p><strong><?php _e( 'Competitions', 'sportspress' ); ?></strong></p>
|
||||
<p><strong><?php _e( 'Leagues', 'sportspress' ); ?></strong></p>
|
||||
<p><?php
|
||||
$args = array(
|
||||
'taxonomy' => 'sp_league',
|
||||
'name' => 'tax_input[sp_league][]',
|
||||
'selected' => $league_ids,
|
||||
'values' => 'term_id',
|
||||
'placeholder' => sprintf( __( 'Select %s', 'sportspress' ), __( 'Competitions', 'sportspress' ) ),
|
||||
'placeholder' => sprintf( __( 'Select %s', 'sportspress' ), __( 'Leagues', 'sportspress' ) ),
|
||||
'class' => 'widefat',
|
||||
'property' => 'multiple',
|
||||
'chosen' => true,
|
||||
|
||||
@@ -58,7 +58,7 @@ class SP_Meta_Box_Team_Lists {
|
||||
<?php _e( 'Players', 'sportspress' ); ?>
|
||||
</th>
|
||||
<th class="column-league">
|
||||
<?php _e( 'Competition', 'sportspress' ); ?>
|
||||
<?php _e( 'League', 'sportspress' ); ?>
|
||||
</th>
|
||||
<th class="column-season">
|
||||
<?php _e( 'Season', 'sportspress' ); ?>
|
||||
|
||||
@@ -58,7 +58,7 @@ class SP_Meta_Box_Team_Staff {
|
||||
<?php _e( 'Job', 'sportspress' ); ?>
|
||||
</th>
|
||||
<th class="column-league">
|
||||
<?php _e( 'Competition', 'sportspress' ); ?>
|
||||
<?php _e( 'League', 'sportspress' ); ?>
|
||||
</th>
|
||||
<th class="column-season">
|
||||
<?php _e( 'Season', 'sportspress' ); ?>
|
||||
|
||||
@@ -58,7 +58,7 @@ class SP_Meta_Box_Team_Tables {
|
||||
<?php _e( 'Teams', 'sportspress' ); ?>
|
||||
</th>
|
||||
<th class="column-league">
|
||||
<?php _e( 'Competition', 'sportspress' ); ?>
|
||||
<?php _e( 'League', 'sportspress' ); ?>
|
||||
</th>
|
||||
<th class="column-season">
|
||||
<?php _e( 'Season', 'sportspress' ); ?>
|
||||
|
||||
@@ -107,7 +107,7 @@ class SP_Settings_Players extends SP_Settings_Page {
|
||||
),
|
||||
|
||||
array(
|
||||
'desc' => __( 'Competitions', 'sportspress' ),
|
||||
'desc' => __( 'Leagues', 'sportspress' ),
|
||||
'id' => 'sportspress_player_show_leagues',
|
||||
'default' => 'no',
|
||||
'type' => 'checkbox',
|
||||
|
||||
@@ -331,7 +331,7 @@ class SP_Settings_Status extends SP_Settings_Page {
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><?php _e( 'Competitions', 'sportspress' ); ?>:</td>
|
||||
<td><?php _e( 'Leagues', 'sportspress' ); ?>:</td>
|
||||
<td><?php
|
||||
$display_terms = array();
|
||||
$terms = get_terms( 'sp_league', array( 'hide_empty' => 0 ) );
|
||||
|
||||
@@ -293,7 +293,7 @@
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><?php _e( 'Competitions', 'sportspress' ); ?>:</td>
|
||||
<td><?php _e( 'Leagues', 'sportspress' ); ?>:</td>
|
||||
<td><?php
|
||||
$display_terms = array();
|
||||
$terms = get_terms( 'sp_league', array( 'hide_empty' => 0 ) );
|
||||
|
||||
Reference in New Issue
Block a user