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,11 +1,18 @@
<?php
function sportspress_column_post_init() {
$name = __( 'Columns', 'sportspress' );
$singular_name = __( 'Column', 'sportspress' );
$lowercase_name = __( 'columns', 'sportspress' );
$labels = sportspress_get_post_labels( $name, $singular_name, $lowercase_name, true );
$labels = array(
'name' => __( 'Columns', 'sportspress' ),
'singular_name' => __( 'Column', 'sportspress' ),
'add_new_item' => __( 'Add New Column', 'sportspress' ),
'edit_item' => __( 'Edit Column', 'sportspress' ),
'new_item' => __( 'New Column', 'sportspress' ),
'view_item' => __( 'View Column', 'sportspress' ),
'search_items' => __( 'Search Columns', 'sportspress' ),
'not_found' => __( 'No columns found.', 'sportspress' ),
'not_found_in_trash' => __( 'No columns found in trash.', 'sportspress' ),
);
$args = array(
'label' => $name,
'label' => __( 'Columns', 'sportspress' ),
'labels' => $labels,
'public' => false,
'show_ui' => true,

View File

@@ -3,17 +3,14 @@ function sportspress_event_post_init() {
$labels = array(
'name' => __( 'Schedule', 'sportspress' ),
'singular_name' => __( 'Event', 'sportspress' ),
'menu_name' => __( 'Schedule', 'sportspress' ),
'all_items' => __( 'Events', 'sportspress' ),
'add_new' => sprintf( __( 'Add Event', 'sportspress' ), __( 'Event', 'sportspress' ) ),
'add_new_item' => sprintf( __( 'Add New %s', 'sportspress' ), __( 'Event', 'sportspress' ) ),
'edit_item' => sprintf( __( 'Edit %s', 'sportspress' ), __( 'Event', 'sportspress' ) ),
'new_item' => sprintf( __( 'New %s', 'sportspress' ), __( 'Event', 'sportspress' ) ),
'view_item' => sprintf( __( 'View %s', 'sportspress' ), __( 'Event', 'sportspress' ) ),
'search_items' => sprintf( __( 'Search %s', 'sportspress' ), __( 'Events', 'sportspress' ) ),
'not_found' => sprintf( __( 'No %s found.', 'sportspress' ), __( 'events', 'sportspress' ) ),
'not_found_in_trash' => sprintf( __( 'No %s found in trash.', 'sportspress' ), __( 'events', 'sportspress' ) ),
'parent_item_colon' => sprintf( __( 'Parent %s', 'sportspress' ), __( 'Event', 'sportspress' ) ) . ':'
'add_new_item' => __( 'Add New Event', 'sportspress' ),
'edit_item' => __( 'Edit Event', 'sportspress' ),
'new_item' => __( 'New Event', 'sportspress' ),
'view_item' => __( 'View Event', 'sportspress' ),
'search_items' => __( 'Search Events', 'sportspress' ),
'not_found' => __( 'No events found.', 'sportspress' ),
'not_found_in_trash' => __( 'No events found in trash.', 'sportspress' ),
);
$args = array(
'label' => __( 'Events', 'sportspress' ),
@@ -79,7 +76,7 @@ function sportspress_event_details_meta( $post ) {
'show_option_none' => __( '-- Not set --', 'sportspress' ),
);
if ( ! sportspress_dropdown_taxonomies( $args ) ):
sportspress_taxonomy_adder( 'sp_league', 'sp_team' );
sportspress_taxonomy_adder( 'sp_league', 'sp_team', __( 'Add New League', 'sportspress' ) );
endif;
?>
</p>
@@ -94,7 +91,7 @@ function sportspress_event_details_meta( $post ) {
'show_option_none' => __( '-- Not set --', 'sportspress' ),
);
if ( ! sportspress_dropdown_taxonomies( $args ) ):
sportspress_taxonomy_adder( 'sp_season', 'sp_team' );
sportspress_taxonomy_adder( 'sp_season', 'sp_team', __( 'Add New Season', 'sportspress' ) );
endif;
?>
</p>
@@ -109,7 +106,7 @@ function sportspress_event_details_meta( $post ) {
'show_option_none' => __( '-- Not set --', 'sportspress' ),
);
if ( ! sportspress_dropdown_taxonomies( $args ) ):
sportspress_taxonomy_adder( 'sp_venue', 'sp_event' );
sportspress_taxonomy_adder( 'sp_venue', 'sp_event', __( 'Add New Venue', 'sportspress' ) );
endif;
?>
</p>

View File

@@ -1,11 +1,18 @@
<?php
function sportspress_list_post_init() {
$name = __( 'Player Lists', 'sportspress' );
$singular_name = __( 'Player List', 'sportspress' );
$lowercase_name = __( 'player lists', 'sportspress' );
$labels = sportspress_get_post_labels( $name, $singular_name, $lowercase_name, true );
$labels = array(
'name' => __( 'Player Lists', 'sportspress' ),
'singular_name' => __( 'Player List', 'sportspress' ),
'add_new_item' => __( 'Add New Player List', 'sportspress' ),
'edit_item' => __( 'Edit Player List', 'sportspress' ),
'new_item' => __( 'New Player List', 'sportspress' ),
'view_item' => __( 'View Player List', 'sportspress' ),
'search_items' => __( 'Search Player Lists', 'sportspress' ),
'not_found' => __( 'No player lists found.', 'sportspress' ),
'not_found_in_trash' => __( 'No player lists found in trash.', 'sportspress' ),
);
$args = array(
'label' => $name,
'label' => __( 'Player Lists', 'sportspress' ),
'labels' => $labels,
'public' => true,
'has_archive' => false,
@@ -67,7 +74,7 @@ function sportspress_list_player_meta( $post ) {
'values' => 'term_id',
);
if ( ! sportspress_dropdown_taxonomies( $args ) ):
sportspress_taxonomy_adder( 'sp_league', 'sp_team' );
sportspress_taxonomy_adder( 'sp_league', 'sp_team', __( 'Add New League', 'sportspress' ) );
endif;
?>
</p>
@@ -81,7 +88,7 @@ function sportspress_list_player_meta( $post ) {
'values' => 'term_id',
);
if ( ! sportspress_dropdown_taxonomies( $args ) ):
sportspress_taxonomy_adder( 'sp_season', 'sp_team' );
sportspress_taxonomy_adder( 'sp_season', 'sp_team', __( 'Add New Season', 'sportspress' ) );
endif;
?>
</p>
@@ -91,12 +98,12 @@ function sportspress_list_player_meta( $post ) {
$args = array(
'post_type' => 'sp_team',
'name' => 'sp_team',
'show_option_all' => sprintf( __( 'All %s', 'sportspress' ), __( 'Teams', 'sportspress' ) ),
'show_option_all' => __( 'All Teams', 'sportspress' ),
'selected' => $team_id,
'values' => 'ID',
);
if ( ! sportspress_dropdown_pages( $args ) ):
sportspress_post_adder( 'sp_team' );
sportspress_post_adder( 'sp_team', __( 'Add New Team', 'sportspress' ) );
endif;
?>
</p>
@@ -115,7 +122,7 @@ function sportspress_list_player_meta( $post ) {
'values' => 'slug',
);
if ( ! sportspress_dropdown_pages( $args ) ):
sportspress_post_adder( 'sp_list' );
sportspress_post_adder( 'sp_list', __( 'Add New Player List', 'sportspress' ) );
endif;
?>
</p>
@@ -129,7 +136,7 @@ function sportspress_list_player_meta( $post ) {
<p><strong><?php _e( 'Players', 'sportspress' ); ?></strong></p>
<?php
sportspress_post_checklist( $post->ID, 'sp_player', 'block', 'sp_team' );
sportspress_post_adder( 'sp_player' );
sportspress_post_adder( 'sp_player', __( 'Add New Player', 'sportspress' ) );
?>
</div>
<?php

View File

@@ -1,11 +1,18 @@
<?php
function sportspress_metric_post_init() {
$name = __( 'Metrics', 'sportspress' );
$singular_name = __( 'Metric', 'sportspress' );
$lowercase_name = __( 'metrics', 'sportspress' );
$labels = sportspress_get_post_labels( $name, $singular_name, $lowercase_name, true );
$labels = array(
'name' => __( 'Metrics', 'sportspress' ),
'singular_name' => __( 'Metric', 'sportspress' ),
'add_new_item' => __( 'Add New Metric', 'sportspress' ),
'edit_item' => __( 'Edit Metric', 'sportspress' ),
'new_item' => __( 'New Metric', 'sportspress' ),
'view_item' => __( 'View Metric', 'sportspress' ),
'search_items' => __( 'Search Metrics', 'sportspress' ),
'not_found' => __( 'No metrics found.', 'sportspress' ),
'not_found_in_trash' => __( 'No metrics found in trash.', 'sportspress' ),
);
$args = array(
'label' => $name,
'label' => __( 'Metrics', 'sportspress' ),
'labels' => $labels,
'public' => false,
'show_ui' => true,

View File

@@ -1,11 +1,18 @@
<?php
function sportspress_outcome_post_init() {
$name = __( 'Outcomes', 'sportspress' );
$singular_name = __( 'Outcome', 'sportspress' );
$lowercase_name = __( 'outcome', 'sportspress' );
$labels = sportspress_get_post_labels( $name, $singular_name, $lowercase_name, true );
$labels = array(
'name' => __( 'Outcomes', 'sportspress' ),
'singular_name' => __( 'Outcome', 'sportspress' ),
'add_new_item' => __( 'Add New Outcome', 'sportspress' ),
'edit_item' => __( 'Edit Outcome', 'sportspress' ),
'new_item' => __( 'New Outcome', 'sportspress' ),
'view_item' => __( 'View Outcome', 'sportspress' ),
'search_items' => __( 'Search Outcomes', 'sportspress' ),
'not_found' => __( 'No outcomes found.', 'sportspress' ),
'not_found_in_trash' => __( 'No outcomes found in trash.', 'sportspress' ),
);
$args = array(
'label' => $name,
'label' => __( 'Outcomes', 'sportspress' ),
'labels' => $labels,
'public' => false,
'show_ui' => true,

View File

@@ -1,11 +1,18 @@
<?php
function sportspress_player_post_init() {
$name = __( 'Players', 'sportspress' );
$singular_name = __( 'Player', 'sportspress' );
$lowercase_name = __( 'players', 'sportspress' );
$labels = sportspress_get_post_labels( $name, $singular_name, $lowercase_name );
$labels = array(
'name' => __( 'Players', 'sportspress' ),
'singular_name' => __( 'Player', 'sportspress' ),
'add_new_item' => __( 'Add New Player', 'sportspress' ),
'edit_item' => __( 'Edit Player', 'sportspress' ),
'new_item' => __( 'New Player', 'sportspress' ),
'view_item' => __( 'View Player', 'sportspress' ),
'search_items' => __( 'Search Players', 'sportspress' ),
'not_found' => __( 'No players found.', 'sportspress' ),
'not_found_in_trash' => __( 'No players found in trash.', 'sportspress' ),
);
$args = array(
'label' => $name,
'label' => __( 'Players', 'sportspress' ),
'labels' => $labels,
'public' => true,
'has_archive' => false,
@@ -227,7 +234,7 @@ function sportspress_player_metrics_meta( $post ) {
<?php
endforeach;
else:
sportspress_post_adder( 'sp_metric' );
sportspress_post_adder( 'sp_metric', __( 'Add New Metric', 'sportspress' ) );
endif;
sportspress_nonce();

View File

@@ -1,11 +1,18 @@
<?php
function sportspress_result_post_init() {
$name = __( 'Results', 'sportspress' );
$singular_name = __( 'Result', 'sportspress' );
$lowercase_name = __( 'result', 'sportspress' );
$labels = sportspress_get_post_labels( $name, $singular_name, $lowercase_name, true );
$labels = array(
'name' => __( 'Results', 'sportspress' ),
'singular_name' => __( 'Result', 'sportspress' ),
'add_new_item' => __( 'Add New Result', 'sportspress' ),
'edit_item' => __( 'Edit Result', 'sportspress' ),
'new_item' => __( 'New Result', 'sportspress' ),
'view_item' => __( 'View Result', 'sportspress' ),
'search_items' => __( 'Search Results', 'sportspress' ),
'not_found' => __( 'No results found.', 'sportspress' ),
'not_found_in_trash' => __( 'No results found in trash.', 'sportspress' ),
);
$args = array(
'label' => $name,
'label' => __( 'Results', 'sportspress' ),
'labels' => $labels,
'public' => false,
'show_ui' => true,

View File

@@ -1,11 +1,18 @@
<?php
function sportspress_staff_post_init() {
$name = __( 'Staff', 'sportspress' );
$singular_name = __( 'Staff', 'sportspress' );
$lowercase_name = __( 'staff', 'sportspress' );
$labels = sportspress_get_post_labels( $name, $singular_name, $lowercase_name );
$labels = array(
'name' => __( 'Staff', 'sportspress' ),
'singular_name' => __( 'Staff', 'sportspress' ),
'add_new_item' => __( 'Add New Staff', 'sportspress' ),
'edit_item' => __( 'Edit Staff', 'sportspress' ),
'new_item' => __( 'New Staff', 'sportspress' ),
'view_item' => __( 'View Staff', 'sportspress' ),
'search_items' => __( 'Search Staff', 'sportspress' ),
'not_found' => __( 'No staff found.', 'sportspress' ),
'not_found_in_trash' => __( 'No staff found in trash.', 'sportspress' ),
);
$args = array(
'label' => $name,
'label' => __( 'Staff', 'sportspress' ),
'labels' => $labels,
'public' => true,
'has_archive' => false,
@@ -30,7 +37,7 @@ function sportspress_staff_meta_init() {
}
function sportspress_staff_team_meta( $post ) {
sportspress_post_checklist( $post->ID, 'sp_team' );
sportspress_post_adder( 'sp_team' );
sportspress_post_adder( 'sp_team', __( 'Add New Team', 'sportspress' ) );
sportspress_nonce();
}

View File

@@ -1,11 +1,18 @@
<?php
function sportspress_statistic_post_init() {
$name = __( 'Statistics', 'sportspress' );
$singular_name = __( 'Statistic', 'sportspress' );
$lowercase_name = __( 'statistics', 'sportspress' );
$labels = sportspress_get_post_labels( $name, $singular_name, $lowercase_name, true );
$labels = array(
'name' => __( 'Statistics', 'sportspress' ),
'singular_name' => __( 'Statistic', 'sportspress' ),
'add_new_item' => __( 'Add New Statistic', 'sportspress' ),
'edit_item' => __( 'Edit Statistic', 'sportspress' ),
'new_item' => __( 'New Statistic', 'sportspress' ),
'view_item' => __( 'View Statistic', 'sportspress' ),
'search_items' => __( 'Search Statistics', 'sportspress' ),
'not_found' => __( 'No statistics found.', 'sportspress' ),
'not_found_in_trash' => __( 'No statistics found in trash.', 'sportspress' ),
);
$args = array(
'label' => $name,
'label' => __( 'Statistics', 'sportspress' ),
'labels' => $labels,
'public' => false,
'show_ui' => true,

View File

@@ -1,11 +1,18 @@
<?php
function sportspress_table_post_init() {
$name = __( 'League Tables', 'sportspress' );
$singular_name = __( 'League Table', 'sportspress' );
$lowercase_name = __( 'league tables', 'sportspress' );
$labels = sportspress_get_post_labels( $name, $singular_name, $lowercase_name, true );
$labels = array(
'name' => __( 'League Tables', 'sportspress' ),
'singular_name' => __( 'League Table', 'sportspress' ),
'add_new_item' => __( 'Add New League Table', 'sportspress' ),
'edit_item' => __( 'Edit League Table', 'sportspress' ),
'new_item' => __( 'New League Table', 'sportspress' ),
'view_item' => __( 'View League Table', 'sportspress' ),
'search_items' => __( 'Search League Tables', 'sportspress' ),
'not_found' => __( 'No league tables found.', 'sportspress' ),
'not_found_in_trash' => __( 'No league tables found in trash.', 'sportspress' ),
);
$args = array(
'label' => $name,
'label' => __( 'League Tables', 'sportspress' ),
'labels' => $labels,
'public' => true,
'has_archive' => false,
@@ -63,7 +70,7 @@ function sportspress_table_team_meta( $post, $test ) {
'values' => 'term_id'
);
if ( ! sportspress_dropdown_taxonomies( $args ) ):
sportspress_taxonomy_adder( 'sp_league', 'sp_team' );
sportspress_taxonomy_adder( 'sp_league', 'sp_team', __( 'Add New League', 'sportspress' ) );
endif;
?>
</p>
@@ -77,14 +84,14 @@ function sportspress_table_team_meta( $post, $test ) {
'values' => 'term_id'
);
if ( ! sportspress_dropdown_taxonomies( $args ) ):
sportspress_taxonomy_adder( 'sp_season', 'sp_team' );
sportspress_taxonomy_adder( 'sp_season', 'sp_team', __( 'Add New Season', 'sportspress' ) );
endif;
?>
</p>
<p><strong><?php _e( 'Teams', 'sportspress' ); ?></strong></p>
<?php
sportspress_post_checklist( $post->ID, 'sp_team', 'block', 'sp_season' );
sportspress_post_adder( 'sp_team' );
sportspress_post_adder( 'sp_team', __( 'Add New Team', 'sportspress' ) );
?>
</div>
<?php

View File

@@ -1,11 +1,19 @@
<?php
function sportspress_team_post_init() {
$name = __( 'Teams', 'sportspress' );
$singular_name = __( 'Team', 'sportspress' );
$lowercase_name = __( 'teams', 'sportspress' );
$labels = sportspress_get_post_labels( $name, $singular_name, $lowercase_name );
$labels = array(
'name' => __( 'Teams', 'sportspress' ),
'singular_name' => __( 'Team', 'sportspress' ),
'add_new_item' => __( 'Add New Team', 'sportspress' ),
'edit_item' => __( 'Edit Team', 'sportspress' ),
'new_item' => __( 'New Team', 'sportspress' ),
'view_item' => __( 'View Team', 'sportspress' ),
'search_items' => __( 'Search Teams', 'sportspress' ),
'not_found' => __( 'No teams found.', 'sportspress' ),
'not_found_in_trash' => __( 'No teams found in trash.', 'sportspress' ),
'parent_item_colon' => __( 'Parent Team:', 'sportspress' ),
);
$args = array(
'label' => $name,
'label' => __( 'Teams', 'sportspress' ),
'labels' => $labels,
'public' => true,
'has_archive' => false,