Replace dynamic strings with static ones

This commit is contained in:
Brian Miyaji
2014-02-21 08:35:46 +11:00
parent 1318cfdced
commit 38e53ac37c
32 changed files with 294 additions and 227 deletions

View File

@@ -1,12 +1,21 @@
<?php
function sportspress_league_term_init() {
$name = __( 'Leagues', 'sportspress' );
$singular_name = __( 'League', 'sportspress' );
$lowercase_name = __( 'league', 'sportspress' );
$object_type = array( 'sp_event', 'sp_team', 'sp_table', 'sp_player', 'sp_list', 'sp_staff' );
$labels = sportspress_get_term_labels( $name, $singular_name, $lowercase_name );
$labels = array(
'name' => __( 'Leagues', 'sportspress' ),
'singular_name' => __( 'League', 'sportspress' ),
'all_items' => __( 'All Leagues', 'sportspress' ),
'edit_item' => __( 'Edit League', 'sportspress' ),
'view_item' => __( 'View League', 'sportspress' ),
'update_item' => __( 'Update League', 'sportspress' ),
'add_new_item' => __( 'Add New League', 'sportspress' ),
'new_item_name' => __( 'New League Name', 'sportspress' ),
'parent_item' => __( 'Parent League', 'sportspress' ),
'parent_item_colon' => __( 'Parent League:', 'sportspress' ),
'search_items' => __( 'Search Leagues', 'sportspress' ),
'not_found' => __( 'No leagues found.', 'sportspress' ),
);
$args = array(
'label' => $name,
'label' => __( 'Leagues', 'sportspress' ),
'labels' => $labels,
'public' => true,
'show_in_nav_menus' => false,
@@ -14,12 +23,10 @@ function sportspress_league_term_init() {
'hierarchical' => true,
'rewrite' => array( 'slug' => 'league' ),
);
register_taxonomy( 'sp_league', $object_type, $args );
register_taxonomy_for_object_type( 'sp_league', 'sp_event' );
register_taxonomy_for_object_type( 'sp_league', 'sp_team' );
register_taxonomy_for_object_type( 'sp_league', 'sp_table' );
register_taxonomy_for_object_type( 'sp_league', 'sp_player' );
register_taxonomy_for_object_type( 'sp_league', 'sp_list' );
register_taxonomy_for_object_type( 'sp_league', 'sp_staff' );
$object_types = array( 'sp_event', 'sp_team', 'sp_table', 'sp_player', 'sp_list', 'sp_staff' );
register_taxonomy( 'sp_league', $object_types, $args );
foreach ( $object_types as $object_type ):
register_taxonomy_for_object_type( 'sp_league', $object_type );
endforeach;
}
add_action( 'init', 'sportspress_league_term_init' );

View File

@@ -1,12 +1,21 @@
<?php
function sportspress_position_term_init() {
$name = __( 'Positions', 'sportspress' );
$singular_name = __( 'Position', 'sportspress' );
$lowercase_name = __( 'position', 'sportspress' );
$object_type = array( 'sp_player', 'sp_statistic', 'sp_metric', 'attachment' );
$labels = sportspress_get_term_labels( $name, $singular_name, $lowercase_name );
$labels = array(
'name' => __( 'Positions', 'sportspress' ),
'singular_name' => __( 'Position', 'sportspress' ),
'all_items' => __( 'All Positions', 'sportspress' ),
'edit_item' => __( 'Edit Position', 'sportspress' ),
'view_item' => __( 'View Position', 'sportspress' ),
'update_item' => __( 'Update Position', 'sportspress' ),
'add_new_item' => __( 'Add New Position', 'sportspress' ),
'new_item_name' => __( 'New Position Name', 'sportspress' ),
'parent_item' => __( 'Parent Position', 'sportspress' ),
'parent_item_colon' => __( 'Parent Position:', 'sportspress' ),
'search_items' => __( 'Search Positions', 'sportspress' ),
'not_found' => __( 'No positions found.', 'sportspress' ),
);
$args = array(
'label' => $name,
'label' => __( 'Positions', 'sportspress' ),
'labels' => $labels,
'public' => true,
'show_in_nav_menus' => false,
@@ -14,10 +23,10 @@ function sportspress_position_term_init() {
'hierarchical' => true,
'rewrite' => array( 'slug' => 'position' ),
);
register_taxonomy( 'sp_position', $object_type, $args );
register_taxonomy_for_object_type( 'sp_position', 'sp_player' );
register_taxonomy_for_object_type( 'sp_position', 'sp_statistic' );
register_taxonomy_for_object_type( 'sp_position', 'sp_metric' );
register_taxonomy_for_object_type( 'sp_position', 'attachment' );
$object_types = array( 'sp_player', 'sp_statistic', 'sp_metric', 'attachment' );
register_taxonomy( 'sp_position', $object_types, $args );
foreach ( $object_types as $object_type ):
register_taxonomy_for_object_type( 'sp_league', $object_type );
endforeach;
}
add_action( 'init', 'sportspress_position_term_init' );

View File

@@ -1,12 +1,21 @@
<?php
function sportspress_season_term_init() {
$name = __( 'Seasons', 'sportspress' );
$singular_name = __( 'Season', 'sportspress' );
$lowercase_name = __( 'season', 'sportspress' );
$object_type = array( 'sp_event', 'sp_team', 'sp_table', 'sp_player', 'sp_list', 'sp_staff' );
$labels = sportspress_get_term_labels( $name, $singular_name, $lowercase_name );
$labels = array(
'name' => __( 'Seasons', 'sportspress' ),
'singular_name' => __( 'Season', 'sportspress' ),
'all_items' => __( 'All Seasons', 'sportspress' ),
'edit_item' => __( 'Edit Season', 'sportspress' ),
'view_item' => __( 'View Season', 'sportspress' ),
'update_item' => __( 'Update Season', 'sportspress' ),
'add_new_item' => __( 'Add New Season', 'sportspress' ),
'new_item_name' => __( 'New Season Name', 'sportspress' ),
'parent_item' => __( 'Parent Season', 'sportspress' ),
'parent_item_colon' => __( 'Parent Season:', 'sportspress' ),
'search_items' => __( 'Search Seasons', 'sportspress' ),
'not_found' => __( 'No seasons found.', 'sportspress' ),
);
$args = array(
'label' => $name,
'label' => __( 'Seasons', 'sportspress' ),
'labels' => $labels,
'public' => true,
'show_in_nav_menus' => false,
@@ -14,12 +23,10 @@ function sportspress_season_term_init() {
'hierarchical' => true,
'rewrite' => array( 'slug' => 'season' ),
);
register_taxonomy( 'sp_season', $object_type, $args );
register_taxonomy_for_object_type( 'sp_season', 'sp_event' );
register_taxonomy_for_object_type( 'sp_season', 'sp_team' );
register_taxonomy_for_object_type( 'sp_season', 'sp_table' );
register_taxonomy_for_object_type( 'sp_season', 'sp_player' );
register_taxonomy_for_object_type( 'sp_season', 'sp_list' );
register_taxonomy_for_object_type( 'sp_season', 'sp_staff' );
$object_types = array( 'sp_event', 'sp_team', 'sp_table', 'sp_player', 'sp_list', 'sp_staff' );
register_taxonomy( 'sp_season', $object_types, $args );
foreach ( $object_types as $object_type ):
register_taxonomy_for_object_type( 'sp_league', $object_type );
endforeach;
}
add_action( 'init', 'sportspress_season_term_init' );

View File

@@ -1,12 +1,21 @@
<?php
function sportspress_venue_term_init() {
$name = __( 'Venues', 'sportspress' );
$singular_name = __( 'Venue', 'sportspress' );
$lowercase_name = __( 'venue', 'sportspress' );
$object_type = array( 'sp_event', 'attachment' );
$labels = sportspress_get_term_labels( $name, $singular_name, $lowercase_name );
$labels = array(
'name' => __( 'Venues', 'sportspress' ),
'singular_name' => __( 'Venue', 'sportspress' ),
'all_items' => __( 'All Venues', 'sportspress' ),
'edit_item' => __( 'Edit Venue', 'sportspress' ),
'view_item' => __( 'View Venue', 'sportspress' ),
'update_item' => __( 'Update Venue', 'sportspress' ),
'add_new_item' => __( 'Add New Venue', 'sportspress' ),
'new_item_name' => __( 'New Venue Name', 'sportspress' ),
'parent_item' => __( 'Parent Venue', 'sportspress' ),
'parent_item_colon' => __( 'Parent Venue:', 'sportspress' ),
'search_items' => __( 'Search Venues', 'sportspress' ),
'not_found' => __( 'No venues found.', 'sportspress' ),
);
$args = array(
'label' => $name,
'label' => __( 'Venues', 'sportspress' ),
'labels' => $labels,
'public' => true,
'show_in_nav_menus' => false,
@@ -14,9 +23,11 @@ function sportspress_venue_term_init() {
'hierarchical' => true,
'rewrite' => array( 'slug' => 'venue' ),
);
register_taxonomy( 'sp_venue', $object_type, $args );
register_taxonomy_for_object_type( 'sp_venue', 'sp_event' );
register_taxonomy_for_object_type( 'sp_venue', 'attachment' );
$object_types = array( 'sp_event', 'attachment' );
register_taxonomy( 'sp_venue', $object_types, $args );
foreach ( $object_types as $object_type ):
register_taxonomy_for_object_type( 'sp_league', $object_type );
endforeach;
}
add_action( 'init', 'sportspress_venue_term_init' );