Replace dynamic strings with static ones
This commit is contained in:
@@ -2,16 +2,16 @@
|
||||
function sportspress_admin_post_thumbnail_html( $translated_text, $post_id ) {
|
||||
$texts = array(
|
||||
'sp_team' => array(
|
||||
'Set featured image' => sprintf( __( 'Select %s', 'sportspress' ), __( 'Logo', 'sportspress' ) ),
|
||||
'Remove featured image' => sprintf( __( 'Select %s', 'sportspress' ), __( 'Logo', 'sportspress' ) ),
|
||||
'Set featured image' => __( 'Select Logo', 'sportspress' ),
|
||||
'Remove featured image' => __( 'Remove Logo', 'sportspress' ),
|
||||
),
|
||||
'sp_player' => array(
|
||||
'Set featured image' => sprintf( __( 'Select %s', 'sportspress' ), __( 'Photo', 'sportspress' ) ),
|
||||
'Remove featured image' => sprintf( __( 'Select %s', 'sportspress' ), __( 'Photo', 'sportspress' ) ),
|
||||
'Set featured image' => __( 'Select Photo', 'sportspress' ),
|
||||
'Remove featured image' => __( 'Remove Photo', 'sportspress' ),
|
||||
),
|
||||
'sp_staff' => array(
|
||||
'Set featured image' => sprintf( __( 'Select %s', 'sportspress' ), __( 'Photo', 'sportspress' ) ),
|
||||
'Remove featured image' => sprintf( __( 'Select %s', 'sportspress' ), __( 'Photo', 'sportspress' ) ),
|
||||
'Set featured image' => __( 'Select Photo', 'sportspress' ),
|
||||
'Remove featured image' => __( 'Remove Photo', 'sportspress' ),
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
@@ -9,13 +9,13 @@ function sportspress_gettext( $translated_text, $untranslated_text, $domain ) {
|
||||
$translated_text = __( 'Team', 'sportspress' );
|
||||
break;
|
||||
case 'Set featured image':
|
||||
$translated_text = sprintf( __( 'Select %s', 'sportspress' ), __( 'Logo', 'sportspress' ) );
|
||||
$translated_text = __( 'Select Logo', 'sportspress' );
|
||||
break;
|
||||
case 'Set Featured Image':
|
||||
$translated_text = sprintf( __( 'Select %s', 'sportspress' ), __( 'Logo', 'sportspress' ) );
|
||||
$translated_text = __( 'Select Logo', 'sportspress' );
|
||||
break;
|
||||
case 'Remove featured image':
|
||||
$translated_text = sprintf( __( 'Remove %s', 'sportspress' ), __( 'Logo', 'sportspress' ) );
|
||||
$translated_text = __( 'Remove Logo', 'sportspress' );
|
||||
break;
|
||||
endswitch;
|
||||
elseif ( in_array( $typenow, array( 'sp_event', 'sp_player', 'sp_staff' ) ) ):
|
||||
@@ -24,13 +24,13 @@ function sportspress_gettext( $translated_text, $untranslated_text, $domain ) {
|
||||
$translated_text = __( '(Auto)', 'sportspress' );
|
||||
break;
|
||||
case 'Set featured image':
|
||||
$translated_text = sprintf( __( 'Select %s', 'sportspress' ), __( 'Photo', 'sportspress' ) );
|
||||
$translated_text = __( 'Select Photo', 'sportspress' );
|
||||
break;
|
||||
case 'Set Featured Image':
|
||||
$translated_text = sprintf( __( 'Select %s', 'sportspress' ), __( 'Photo', 'sportspress' ) );
|
||||
$translated_text = __( 'Select Photo', 'sportspress' );
|
||||
break;
|
||||
case 'Remove featured image':
|
||||
$translated_text = sprintf( __( 'Remove %s', 'sportspress' ), __( 'Photo', 'sportspress' ) );
|
||||
$translated_text = __( 'Remove Photo', 'sportspress' );
|
||||
break;
|
||||
case 'Scheduled for: <b>%1$s</b>':
|
||||
$translated_text = __( 'Date/Time: <b>%1$s</b>', 'sportspress' );
|
||||
|
||||
@@ -4,8 +4,8 @@ function sportspress_media_buttons() {
|
||||
//if ( ! in_array( array('post.php', 'page.php', 'page-new.php', 'post-new.php')
|
||||
|
||||
?>
|
||||
<a href="#TB_inline?width=480&inlineId=select_sp_table" class="thickbox button sp-insert sp-insert-map" id="add_gform" title="<?php printf( __( 'Add %s', 'sportspress' ), __( 'Map', 'sportspress' ) ); ?>"><span class="sp-buttons-icon sp-map-buttons-icon "></span> <?php printf( __( 'Add %s', 'sportspress' ), __( 'Map', 'sportspress' ) ); ?></a>
|
||||
<a href="#TB_inline?width=480&inlineId=select_sp_table" class="thickbox button sp-insert sp-insert-table" id="add_gform" title="<?php printf( __( 'Add %s', 'sportspress' ), __( 'League Table', 'sportspress' ) ); ?>"><span class="sp-buttons-icon sp-table-buttons-icon "></span> <?php printf( __( 'Add %s', 'sportspress' ), __( 'League Table', 'sportspress' ) ); ?></a>
|
||||
<a href="#TB_inline?width=480&inlineId=select_sp_table" class="thickbox button sp-insert sp-insert-map" id="add_gform" title="<?php _e( 'Add Map', 'sportspress' ); ?>"><span class="sp-buttons-icon sp-map-buttons-icon "></span> <?php _e( 'Add Map', 'sportspress' ); ?></a>
|
||||
<a href="#TB_inline?width=480&inlineId=select_sp_table" class="thickbox button sp-insert sp-insert-table" id="add_gform" title="<?php _e( 'Add League Table', 'sportspress' ); ?>"><span class="sp-buttons-icon sp-table-buttons-icon "></span> <?php _e( 'Add League Table', 'sportspress' ); ?></a>
|
||||
<?php
|
||||
}
|
||||
add_action( 'media_buttons', 'sportspress_media_buttons', 20 );
|
||||
|
||||
@@ -1,38 +1,41 @@
|
||||
<?php
|
||||
function sportspress_post_updated_messages( $messages ) {
|
||||
|
||||
global $typenow, $post;
|
||||
|
||||
if ( in_array( $typenow, array( 'sp_result', 'sp_outcome', 'sp_column', 'sp_metric', 'sp_statistic' ) ) ):
|
||||
$obj = get_post_type_object( $typenow );
|
||||
|
||||
$messages['post'][1] = sprintf( __( '%s updated.', 'sportspress' ), $obj->labels->singular_name ) .
|
||||
' <a href="' . esc_url( admin_url( 'edit.php?post_type=' . $typenow ) ) . '">' .
|
||||
sprintf( __( 'Edit %s', 'sportspress' ), $obj->labels->name ) . '</a>';
|
||||
for ( $i = 0; $i <= 10; $i++ ):
|
||||
$messages['post'][ $i ] = __( 'Settings saved.', 'sportspress' ) .
|
||||
' <a href="' . esc_url( admin_url( 'edit.php?post_type=' . $typenow ) ) . '">' .
|
||||
__( 'View all', 'sportspress' ) . '</a>';
|
||||
endfor;
|
||||
|
||||
elseif ( in_array( $typenow, array( 'sp_event', 'sp_team', 'sp_table', 'sp_player', 'sp_list', 'sp_staff' ) ) ):
|
||||
$obj = get_post_type_object( $typenow );
|
||||
|
||||
$messages['post'][1] = sprintf( __( '%s updated.', 'sportspress' ), $obj->labels->singular_name ) .
|
||||
$messages['post'][1] = __( 'Changes saved.', 'sportspress' ) .
|
||||
' <a href="' . esc_url( get_permalink($post->ID) ) . '">' . $obj->labels->view_item . '</a>';
|
||||
|
||||
$messages['post'][4] = sprintf( __( '%s updated.', 'sportspress' ), $obj->labels->singular_name );
|
||||
$messages['post'][4] = __( 'Changes saved.', 'sportspress' );
|
||||
|
||||
$messages['post'][6] = sprintf( __( '%s published.', 'sportspress' ), $obj->labels->singular_name ) .
|
||||
$messages['post'][6] = __( 'Success!', 'sportspress' ) .
|
||||
' <a href="' . esc_url( get_permalink($post->ID) ) . '">' . $obj->labels->view_item . '</a>';
|
||||
|
||||
$messages['post'][7] = sprintf( __( '%s saved.', 'sportspress' ), $obj->labels->singular_name );
|
||||
$messages['post'][7] = __( 'Changes saved.', 'sportspress' );
|
||||
|
||||
$messages['post'][8] = sprintf( __( '%s submitted.', 'sportspress' ), $obj->labels->singular_name ) .
|
||||
$messages['post'][8] = __( 'Success!', 'sportspress' ) .
|
||||
' <a target="_blank" href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink($post->ID) ) ) . '">' .
|
||||
sprintf( __( 'Preview %s', 'sportspress' ), $obj->labels->singular_name ) . '</a>';
|
||||
|
||||
$messages['post'][9] = sprintf(
|
||||
__( '%s scheduled for: <strong>%s</strong>.', 'sportspress' ),
|
||||
__( 'Scheduled for: <b>%1$s</b>.', 'sportspress' ),
|
||||
date_i18n( __( 'M j, Y @ G:i', 'sportspress' ), strtotime( $post->post_date ) ), esc_url( get_permalink($post->ID) ) ) .
|
||||
' <a target="_blank" href="' . esc_url( get_permalink($post->ID) ) . '">' .
|
||||
sprintf( __( 'Preview %s', 'sportspress' ), $obj->labels->singular_name ) . '</a>';
|
||||
|
||||
$messages['post'][8] = sprintf( __( '%s draft updated.', 'sportspress' ), $obj->labels->singular_name ) .
|
||||
$messages['post'][10] = __( 'Success!', 'sportspress' ) .
|
||||
' <a target="_blank" href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink($post->ID) ) ) . '">' .
|
||||
sprintf( __( 'Preview %s', 'sportspress' ), $obj->labels->singular_name ) . '</a>';
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ function sportspress_restrict_manage_posts() {
|
||||
if ( in_array( $typenow, array( 'sp_event', 'sp_player', 'sp_staff', 'sp_table', 'sp_list' ) ) ):
|
||||
$selected = isset( $_REQUEST['sp_team'] ) ? $_REQUEST['sp_team'] : null;
|
||||
$args = array(
|
||||
'show_option_none' => sprintf( __( 'All %s', 'sportspress' ), __( 'Teams', 'sportspress' ) ),
|
||||
'show_option_none' => __( 'All Teams', 'sportspress' ),
|
||||
'post_type' => 'sp_team',
|
||||
'name' => 'sp_team',
|
||||
'selected' => $selected
|
||||
@@ -15,7 +15,7 @@ function sportspress_restrict_manage_posts() {
|
||||
if ( in_array( $typenow, array( 'sp_player' ) ) ):
|
||||
$selected = isset( $_REQUEST['sp_position'] ) ? $_REQUEST['sp_position'] : null;
|
||||
$args = array(
|
||||
'show_option_all' => sprintf( __( 'All %s', 'sportspress' ), __( 'Positions', 'sportspress' ) ),
|
||||
'show_option_all' => __( 'All Positions', 'sportspress' ),
|
||||
'taxonomy' => 'sp_position',
|
||||
'name' => 'sp_position',
|
||||
'selected' => $selected
|
||||
@@ -25,7 +25,7 @@ function sportspress_restrict_manage_posts() {
|
||||
if ( in_array( $typenow, array( 'sp_team', 'sp_event', 'sp_player', 'sp_staff', 'sp_table', 'sp_list' ) ) ):
|
||||
$selected = isset( $_REQUEST['sp_season'] ) ? $_REQUEST['sp_season'] : null;
|
||||
$args = array(
|
||||
'show_option_all' => sprintf( __( 'All %s', 'sportspress' ), __( 'Seasons', 'sportspress' ) ),
|
||||
'show_option_all' => __( 'All Seasons', 'sportspress' ),
|
||||
'taxonomy' => 'sp_season',
|
||||
'name' => 'sp_season',
|
||||
'selected' => $selected
|
||||
@@ -37,7 +37,7 @@ function sportspress_restrict_manage_posts() {
|
||||
$args = array(
|
||||
'post_type' => 'sp_team',
|
||||
'name' => 'team',
|
||||
'show_option_none' => sprintf( __( 'All %s', 'sportspress' ), __( 'Teams', 'sportspress' ) ),
|
||||
'show_option_none' => __( 'All Teams', 'sportspress' ),
|
||||
'selected' => $selected,
|
||||
'values' => 'ID',
|
||||
);
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -29,7 +29,7 @@ $data = get_posts( $args );
|
||||
<?php $i++; endforeach; ?>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th colspan="2"><a href="<?php echo admin_url( 'edit.php?post_type=sp_result' ); ?>"><?php printf( __( 'Edit %s', 'sportspress' ), __( 'Results', 'sportspress' ) ); ?></a></th>
|
||||
<th colspan="2"><a href="<?php echo admin_url( 'edit.php?post_type=sp_result' ); ?>"><?php _e( 'Edit Results', 'sportspress' ); ?></a></th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
@@ -60,7 +60,7 @@ $data = get_posts( $args );
|
||||
<?php $i++; endforeach; ?>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th colspan="2"><a href="<?php echo admin_url( 'edit.php?post_type=sp_outcome' ); ?>"><?php printf( __( 'Edit %s', 'sportspress' ), __( 'Outcomes', 'sportspress' ) ); ?></a></th>
|
||||
<th colspan="2"><a href="<?php echo admin_url( 'edit.php?post_type=sp_outcome' ); ?>"><?php _e( 'Edit Outcomes', 'sportspress' ); ?></a></th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
@@ -26,7 +26,7 @@ $data = get_posts( $args );
|
||||
<?php $i++; endforeach; ?>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th colspan="4"><a href="<?php echo admin_url( 'edit.php?post_type=sp_metric' ); ?>"><?php printf( __( 'Edit %s', 'sportspress' ), __( 'Metrics', 'sportspress' ) ); ?></a></th>
|
||||
<th colspan="4"><a href="<?php echo admin_url( 'edit.php?post_type=sp_metric' ); ?>"><?php _e( 'Edit Metrics', 'sportspress' ); ?></a></th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
@@ -58,7 +58,7 @@ $data = get_posts( $args );
|
||||
<?php $i++; endforeach; ?>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th colspan="4"><a href="<?php echo admin_url( 'edit.php?post_type=sp_statistic' ); ?>"><?php printf( __( 'Edit %s', 'sportspress' ), __( 'Statistics', 'sportspress' ) ); ?></a></th>
|
||||
<th colspan="4"><a href="<?php echo admin_url( 'edit.php?post_type=sp_statistic' ); ?>"><?php _e( 'Edit Statistics', 'sportspress' ); ?></a></th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
@@ -30,7 +30,7 @@ $data = get_posts( $args );
|
||||
<?php $i++; endforeach; ?>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th colspan="5"><a href="<?php echo admin_url( 'edit.php?post_type=sp_column' ); ?>"><?php printf( __( 'Edit %s', 'sportspress' ), __( 'Columns', 'sportspress' ) ); ?></a></th>
|
||||
<th colspan="5"><a href="<?php echo admin_url( 'edit.php?post_type=sp_column' ); ?>"><?php _e( 'Edit Columns', 'sportspress' ); ?></a></th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
@@ -157,7 +157,7 @@ if ( !function_exists( 'sportspress_events_calendar' ) ) {
|
||||
$calendar_output .= '<td>';
|
||||
|
||||
if ( array_key_exists($day, $daywithpost) ) // any posts today?
|
||||
$calendar_output .= '<a data-tooltip data-options="disable_for_touch:true" class="has-tip" href="' . ( sizeof( $daywithpost[ $day ] ) > 1 ? add_query_arg( array( 'post_type' => 'sp_event' ), get_day_link( $thisyear, $thismonth, $day ) ) . '" title="' . sprintf( '%s Events', ( sizeof( $daywithpost[ $day ] ) ) ) : get_permalink( $daywithpost[ $day ][0] ) . '" title="' . esc_attr( $ak_titles_for_day[ $day ] ) ) . "\">$day</a>";
|
||||
$calendar_output .= '<a data-tooltip data-options="disable_for_touch:true" class="has-tip" href="' . ( sizeof( $daywithpost[ $day ] ) > 1 ? add_query_arg( array( 'post_type' => 'sp_event' ), get_day_link( $thisyear, $thismonth, $day ) ) . '" title="' . sprintf( '%s events', ( sizeof( $daywithpost[ $day ] ) ) ) : get_permalink( $daywithpost[ $day ][0] ) . '" title="' . esc_attr( $ak_titles_for_day[ $day ] ) ) . "\">$day</a>";
|
||||
else
|
||||
$calendar_output .= $day;
|
||||
$calendar_output .= '</td>';
|
||||
|
||||
@@ -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' );
|
||||
|
||||
@@ -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' );
|
||||
|
||||
@@ -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' );
|
||||
|
||||
@@ -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' );
|
||||
|
||||
|
||||
@@ -211,7 +211,7 @@ if ( class_exists( 'WP_Importer' ) ) {
|
||||
* Performs post-import cleanup of files and the cache
|
||||
*/
|
||||
function import_end() {
|
||||
echo '<p>' . __( 'All done!', 'sportspress' ) . ' <a href="' . admin_url('edit.php?post_type=sp_player') . '">' . sprintf( __( 'View %s', 'sportspress' ), __( 'Players', 'sportspress' ) ) . '</a>' . '</p>';
|
||||
echo '<p>' . __( 'All done!', 'sportspress' ) . ' <a href="' . admin_url('edit.php?post_type=sp_player') . '">' . __( 'View Players', 'sportspress' ) . '</a>' . '</p>';
|
||||
|
||||
do_action( 'import_end' );
|
||||
}
|
||||
@@ -261,7 +261,7 @@ if ( class_exists( 'WP_Importer' ) ) {
|
||||
* @return void
|
||||
*/
|
||||
function header() {
|
||||
echo '<div class="wrap"><h2>' . sprintf( __( 'Import %s', 'sportspress' ), __( 'Players', 'sportspress' ) ) . '</h2>';
|
||||
echo '<div class="wrap"><h2>' . __( 'Import Players', 'sportspress' ) . '</h2>';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -170,7 +170,7 @@ if ( class_exists( 'WP_Importer' ) ) {
|
||||
* Performs post-import cleanup of files and the cache
|
||||
*/
|
||||
function import_end() {
|
||||
echo '<p>' . __( 'All done!', 'sportspress' ) . ' <a href="' . admin_url('edit.php?post_type=sp_team') . '">' . sprintf( __( 'View %s', 'sportspress' ), __( 'Teams', 'sportspress' ) ) . '</a>' . '</p>';
|
||||
echo '<p>' . __( 'All done!', 'sportspress' ) . ' <a href="' . admin_url('edit.php?post_type=sp_team') . '">' . __( 'View Teams', 'sportspress' ) . '</a>' . '</p>';
|
||||
|
||||
do_action( 'import_end' );
|
||||
}
|
||||
@@ -220,7 +220,7 @@ if ( class_exists( 'WP_Importer' ) ) {
|
||||
* @return void
|
||||
*/
|
||||
function header() {
|
||||
echo '<div class="wrap"><h2>' . sprintf( __( 'Import %s', 'sportspress' ), __( 'Teams', 'sportspress' ) ) . '</h2>';
|
||||
echo '<div class="wrap"><h2>' . __( 'Import Teams', 'sportspress' ) . '</h2>';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -34,7 +34,7 @@ class SP_Widget_Countdown extends WP_Widget {
|
||||
<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e( 'Title:', 'sportspress' ); ?></label>
|
||||
<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></p>
|
||||
|
||||
<p><label for="<?php echo $this->get_field_id('event'); ?>"><?php printf( __( 'Select %s:', 'sportspress' ), __( 'Event', 'sportspress' ) ); ?></label>
|
||||
<p><label for="<?php echo $this->get_field_id('event'); ?>"><?php _e( 'Select Event:', 'sportspress' ); ?></label>
|
||||
<?php
|
||||
$args = array(
|
||||
'post_type' => 'sp_event',
|
||||
@@ -48,13 +48,13 @@ class SP_Widget_Countdown extends WP_Widget {
|
||||
'post_status' => 'future',
|
||||
);
|
||||
if ( ! sportspress_dropdown_pages( $args ) ):
|
||||
sportspress_post_adder( 'sp_event' );
|
||||
sportspress_post_adder( 'sp_event', __( 'Add New Event', 'sportspress' ) );
|
||||
endif;
|
||||
?>
|
||||
</p>
|
||||
|
||||
<p><input class="checkbox" type="checkbox" id="<?php echo $this->get_field_id('show_league'); ?>" name="<?php echo $this->get_field_name('show_league'); ?>" value="1" <?php checked( $show_league, 1 ); ?>>
|
||||
<label for="<?php echo $this->get_field_id('show_league'); ?>"><?php printf( __( 'Display %s', 'sportspress' ), __( 'League', 'sportspress' ) ); ?></label></p>
|
||||
<label for="<?php echo $this->get_field_id('show_league'); ?>"><?php _e( 'Display League', 'sportspress' ); ?></label></p>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ class SportsPress_Widget_Future_Events extends WP_Widget {
|
||||
'name' => $this->get_field_name('league'),
|
||||
'id' => $this->get_field_id('league'),
|
||||
'selected' => $league,
|
||||
'show_option_all' => sprintf( __( 'All %s', 'sportspress' ), __( 'Leagues', 'sportspress' ) ),
|
||||
'show_option_all' => __( 'All Leagues', 'sportspress' ),
|
||||
'hide_empty' => 0,
|
||||
'values' => 'term_id',
|
||||
'class' => 'widefat',
|
||||
@@ -78,7 +78,7 @@ class SportsPress_Widget_Future_Events extends WP_Widget {
|
||||
'name' => $this->get_field_name('season'),
|
||||
'id' => $this->get_field_id('season'),
|
||||
'selected' => $season,
|
||||
'show_option_all' => sprintf( __( 'All %s', 'sportspress' ), __( 'Seasons', 'sportspress' ) ),
|
||||
'show_option_all' => __( 'All Seasons', 'sportspress' ),
|
||||
'hide_empty' => 0,
|
||||
'values' => 'term_id',
|
||||
'class' => 'widefat',
|
||||
@@ -94,7 +94,7 @@ class SportsPress_Widget_Future_Events extends WP_Widget {
|
||||
'name' => $this->get_field_name('venue'),
|
||||
'id' => $this->get_field_id('venue'),
|
||||
'selected' => $venue,
|
||||
'show_option_all' => sprintf( __( 'All %s', 'sportspress' ), __( 'Venues', 'sportspress' ) ),
|
||||
'show_option_all' => __( 'All Venues', 'sportspress' ),
|
||||
'hide_empty' => 0,
|
||||
'values' => 'term_id',
|
||||
'class' => 'widefat',
|
||||
@@ -110,17 +110,17 @@ class SportsPress_Widget_Future_Events extends WP_Widget {
|
||||
'name' => $this->get_field_name('team'),
|
||||
'id' => $this->get_field_id('team'),
|
||||
'selected' => $team,
|
||||
'show_option_all' => sprintf( __( 'All %s', 'sportspress' ), __( 'Teams', 'sportspress' ) ),
|
||||
'show_option_all' => __( 'All Teams', 'sportspress' ),
|
||||
'values' => 'ID',
|
||||
'class' => 'widefat',
|
||||
);
|
||||
if ( ! sportspress_dropdown_pages( $args ) ):
|
||||
sportspress_post_adder( 'sp_table' );
|
||||
sportspress_post_adder( 'sp_table', __( 'Add New League Table', 'sportspress' ) );
|
||||
endif;
|
||||
?>
|
||||
</p>
|
||||
|
||||
<p><label for="<?php echo $this->get_field_id('number'); ?>"><?php printf( __( 'Number of %s to show:', 'sportspress' ), __( 'events', 'sportspress' ) ); ?></label>
|
||||
<p><label for="<?php echo $this->get_field_id('number'); ?>"><?php _e( 'Number of events to show:', 'sportspress' ); ?></label>
|
||||
<input id="<?php echo $this->get_field_id('number'); ?>" name="<?php echo $this->get_field_name('number'); ?>" type="text" value="<?php echo $number; ?>" size="3"></p>
|
||||
<?php
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ class SportsPress_Widget_League_Table extends WP_Widget {
|
||||
<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e( 'Title:', 'sportspress' ); ?></label>
|
||||
<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></p>
|
||||
|
||||
<p><label for="<?php echo $this->get_field_id('id'); ?>"><?php printf( __( 'Select %s:', 'sportspress' ), __( 'League Table', 'sportspress' ) ); ?></label>
|
||||
<p><label for="<?php echo $this->get_field_id('id'); ?>"><?php _e( 'Select League Table:', 'sportspress' ); ?></label>
|
||||
<?php
|
||||
$args = array(
|
||||
'post_type' => 'sp_table',
|
||||
@@ -49,7 +49,7 @@ class SportsPress_Widget_League_Table extends WP_Widget {
|
||||
'class' => 'widefat',
|
||||
);
|
||||
if ( ! sportspress_dropdown_pages( $args ) ):
|
||||
sportspress_post_adder( 'sp_table' );
|
||||
sportspress_post_adder( 'sp_table', __( 'Add New League Table', 'sportspress' ) );
|
||||
endif;
|
||||
?>
|
||||
</p>
|
||||
|
||||
@@ -44,7 +44,7 @@ class SportsPress_Widget_Player_list extends WP_Widget {
|
||||
<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e( 'Title:', 'sportspress' ); ?></label>
|
||||
<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></p>
|
||||
|
||||
<p><label for="<?php echo $this->get_field_id('id'); ?>"><?php printf( __( 'Select %s:', 'sportspress' ), __( 'Player List', 'sportspress' ) ); ?></label>
|
||||
<p><label for="<?php echo $this->get_field_id('id'); ?>"><?php _e( 'Select Player List:', 'sportspress' ); ?></label>
|
||||
<?php
|
||||
$args = array(
|
||||
'post_type' => 'sp_list',
|
||||
@@ -55,7 +55,7 @@ class SportsPress_Widget_Player_list extends WP_Widget {
|
||||
'class' => 'widefat',
|
||||
);
|
||||
if ( ! sportspress_dropdown_pages( $args ) ):
|
||||
sportspress_post_adder( 'sp_list' );
|
||||
sportspress_post_adder( 'sp_list', __( 'Add New Player List', 'sportspress' ) );
|
||||
endif;
|
||||
?>
|
||||
</p>
|
||||
@@ -98,7 +98,7 @@ class SportsPress_Widget_Player_list extends WP_Widget {
|
||||
'class' => 'sp-select-orderby widefat',
|
||||
);
|
||||
if ( ! sportspress_dropdown_pages( $args ) ):
|
||||
sportspress_post_adder( 'sp_list' );
|
||||
sportspress_post_adder( 'sp_list', __( 'Add New Player List', 'sportspress' ) );
|
||||
endif;
|
||||
?>
|
||||
</p>
|
||||
|
||||
@@ -62,7 +62,7 @@ class SportsPress_Widget_Recent_Events extends WP_Widget {
|
||||
'name' => $this->get_field_name('league'),
|
||||
'id' => $this->get_field_id('league'),
|
||||
'selected' => $league,
|
||||
'show_option_all' => sprintf( __( 'All %s', 'sportspress' ), __( 'Leagues', 'sportspress' ) ),
|
||||
'show_option_all' => __( 'All Leagues', 'sportspress' ),
|
||||
'hide_empty' => 0,
|
||||
'values' => 'term_id',
|
||||
'class' => 'widefat',
|
||||
@@ -78,7 +78,7 @@ class SportsPress_Widget_Recent_Events extends WP_Widget {
|
||||
'name' => $this->get_field_name('season'),
|
||||
'id' => $this->get_field_id('season'),
|
||||
'selected' => $season,
|
||||
'show_option_all' => sprintf( __( 'All %s', 'sportspress' ), __( 'Seasons', 'sportspress' ) ),
|
||||
'show_option_all' => __( 'All Seasons', 'sportspress' ),
|
||||
'hide_empty' => 0,
|
||||
'values' => 'term_id',
|
||||
'class' => 'widefat',
|
||||
@@ -94,7 +94,7 @@ class SportsPress_Widget_Recent_Events extends WP_Widget {
|
||||
'name' => $this->get_field_name('venue'),
|
||||
'id' => $this->get_field_id('venue'),
|
||||
'selected' => $venue,
|
||||
'show_option_all' => sprintf( __( 'All %s', 'sportspress' ), __( 'Venues', 'sportspress' ) ),
|
||||
'show_option_all' => __( 'All Venues', 'sportspress' ),
|
||||
'hide_empty' => 0,
|
||||
'values' => 'term_id',
|
||||
'class' => 'widefat',
|
||||
@@ -110,17 +110,17 @@ class SportsPress_Widget_Recent_Events extends WP_Widget {
|
||||
'name' => $this->get_field_name('team'),
|
||||
'id' => $this->get_field_id('team'),
|
||||
'selected' => $team,
|
||||
'show_option_all' => sprintf( __( 'All %s', 'sportspress' ), __( 'Teams', 'sportspress' ) ),
|
||||
'show_option_all' => __( 'All Teams', 'sportspress' ),
|
||||
'values' => 'ID',
|
||||
'class' => 'widefat',
|
||||
);
|
||||
if ( ! sportspress_dropdown_pages( $args ) ):
|
||||
sportspress_post_adder( 'sp_table' );
|
||||
sportspress_post_adder( 'sp_table', __( 'Add New League Table', 'sportspress' ) );
|
||||
endif;
|
||||
?>
|
||||
</p>
|
||||
|
||||
<p><label for="<?php echo $this->get_field_id('number'); ?>"><?php printf( __( 'Number of %s to show:', 'sportspress' ), __( 'events', 'sportspress' ) ); ?></label>
|
||||
<p><label for="<?php echo $this->get_field_id('number'); ?>"><?php _e( 'Number of events to show:', 'sportspress' ); ?></label>
|
||||
<input id="<?php echo $this->get_field_id('number'); ?>" name="<?php echo $this->get_field_name('number'); ?>" type="text" value="<?php echo $number; ?>" size="3"></p>
|
||||
<?php
|
||||
}
|
||||
|
||||
@@ -46,48 +46,6 @@ if ( !function_exists( 'sportspress_numbers_to_words' ) ) {
|
||||
}
|
||||
}
|
||||
|
||||
if ( !function_exists( 'sportspress_get_post_labels' ) ) {
|
||||
function sportspress_get_post_labels( $name, $singular_name, $lowercase_name = null ) {
|
||||
if ( !$lowercase_name ) $lowercase_name = $name;
|
||||
$labels = array(
|
||||
'name' => $name,
|
||||
'singular_name' => $singular_name,
|
||||
'all_items' => $name,
|
||||
'add_new' => sprintf( __( 'Add New', 'sportspress' ), $singular_name ),
|
||||
'add_new_item' => sprintf( __( 'Add New %s', 'sportspress' ), $singular_name ),
|
||||
'edit_item' => sprintf( __( 'Edit %s', 'sportspress' ), $singular_name ),
|
||||
'new_item' => sprintf( __( 'New %s', 'sportspress' ), $singular_name ),
|
||||
'view_item' => sprintf( __( 'View %s', 'sportspress' ), $singular_name ),
|
||||
'search_items' => sprintf( __( 'Search %s', 'sportspress' ), $name ),
|
||||
'not_found' => sprintf( __( 'No %s found.', 'sportspress' ), $lowercase_name ),
|
||||
'not_found_in_trash' => sprintf( __( 'No %s found in trash.', 'sportspress' ), $lowercase_name ),
|
||||
'parent_item_colon' => sprintf( __( 'Parent %s', 'sportspress' ), $singular_name ) . ':'
|
||||
);
|
||||
return $labels;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !function_exists( 'sportspress_get_term_labels' ) ) {
|
||||
function sportspress_get_term_labels( $name, $singular_name, $lowercase_name = null ) {
|
||||
if ( !$lowercase_name ) $lowercase_name = $name;
|
||||
$labels = array(
|
||||
'name' => $name,
|
||||
'singular_name' => $singular_name,
|
||||
'all_items' => sprintf( __( 'All %s', 'sportspress' ), $name ),
|
||||
'edit_item' => sprintf( __( 'Edit %s', 'sportspress' ), $singular_name ),
|
||||
'view_item' => sprintf( __( 'View %s', 'sportspress' ), $singular_name ),
|
||||
'update_item' => sprintf( __( 'Update %s', 'sportspress' ), $singular_name ),
|
||||
'add_new_item' => sprintf( __( 'Add New %s', 'sportspress' ), $singular_name ),
|
||||
'new_item_name' => sprintf( __( 'New %s Name', 'sportspress' ), $singular_name ),
|
||||
'parent_item' => sprintf( __( 'Parent %s', 'sportspress' ), $singular_name ),
|
||||
'parent_item_colon' => sprintf( __( 'Parent %s', 'sportspress' ), $singular_name ) . ':',
|
||||
'search_items' => sprintf( __( 'Search %s', 'sportspress' ), $name ),
|
||||
'not_found' => sprintf( __( 'No %s found.', 'sportspress' ), $lowercase_name )
|
||||
);
|
||||
return $labels;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !function_exists( 'sportspress_get_the_term_id' ) ) {
|
||||
function sportspress_get_the_term_id( $post_id, $taxonomy, $index ) {
|
||||
$terms = get_the_terms( $post_id, $taxonomy );
|
||||
@@ -716,7 +674,7 @@ if ( !function_exists( 'sportspress_get_var_calculates' ) ) {
|
||||
if ( !function_exists( 'sportspress_edit_calendar_table' ) ) {
|
||||
function sportspress_edit_calendar_table( $data = array() ) {
|
||||
if ( empty( $data ) ):
|
||||
printf( __( 'No %s found.', 'sportspress' ), __( 'events', 'sportspress' ) );
|
||||
_e( 'No Events found.', 'sportspress' );
|
||||
return false;
|
||||
endif;
|
||||
?>
|
||||
@@ -1171,13 +1129,15 @@ if ( !function_exists( 'sportspress_player_nationality_selector' ) ) {
|
||||
}
|
||||
|
||||
if ( !function_exists( 'sportspress_post_adder' ) ) {
|
||||
function sportspress_post_adder( $post_type = 'post' ) {
|
||||
function sportspress_post_adder( $post_type = 'post', $label = null ) {
|
||||
$obj = get_post_type_object( $post_type );
|
||||
if ( $label == null )
|
||||
$label = __( 'Add New', 'sportspress' );
|
||||
?>
|
||||
<div id="<?php echo $post_type; ?>-adder">
|
||||
<h4>
|
||||
<a title="<?php echo sprintf( esc_attr__( 'Add New %s', 'sportspress' ), esc_attr( $obj->labels->singular_name ) ); ?>" href="<?php echo admin_url( 'post-new.php?post_type=' . $post_type ); ?>" target="_blank">
|
||||
+ <?php echo sprintf( __( 'Add New %s', 'sportspress' ), $obj->labels->singular_name ); ?>
|
||||
<a title="<?php echo esc_attr( $label ); ?>" href="<?php echo admin_url( 'post-new.php?post_type=' . $post_type ); ?>" target="_blank">
|
||||
+ <?php echo $label; ?>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
@@ -1186,13 +1146,15 @@ if ( !function_exists( 'sportspress_post_adder' ) ) {
|
||||
}
|
||||
|
||||
if ( !function_exists( 'sportspress_taxonomy_adder' ) ) {
|
||||
function sportspress_taxonomy_adder( $taxonomy = 'category', $post_type = 'post' ) {
|
||||
function sportspress_taxonomy_adder( $taxonomy = 'category', $post_type = 'post', $label = null ) {
|
||||
$obj = get_taxonomy( $taxonomy );
|
||||
if ( $label == null )
|
||||
$label = __( 'Add New', 'sportspress' );
|
||||
?>
|
||||
<div id="<?php echo $taxonomy; ?>-adder">
|
||||
<h4>
|
||||
<a title="<?php echo sprintf( esc_attr__( 'Add New %s', 'sportspress' ), esc_attr( $obj->labels->singular_name ) ); ?>" href="<?php echo admin_url( 'edit-tags.php?taxonomy=' . $taxonomy . '&post_type=' . $post_type ); ?>" target="_blank">
|
||||
+ <?php echo sprintf( __( 'Add New %s', 'sportspress' ), $obj->labels->singular_name ); ?>
|
||||
<a title="<?php echo esc_attr( $label ); ?>" href="<?php echo admin_url( 'edit-tags.php?taxonomy=' . $taxonomy . '&post_type=' . $post_type ); ?>" target="_blank">
|
||||
+ <?php echo $label; ?>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user