Adjust text options to modify front-end only
This commit is contained in:
@@ -70,14 +70,13 @@ function sportspress_gettext( $translated_text, $untranslated_text, $domain ) {
|
||||
$translated_text = $venue->name;
|
||||
endif;
|
||||
endif;
|
||||
endif;
|
||||
|
||||
if ( isset( $sportspress_options['text'] ) ):
|
||||
foreach( $sportspress_options['text'] as $key => $value ):
|
||||
if ( $untranslated_text == $key ):
|
||||
$translated_text = $value;
|
||||
endif;
|
||||
endforeach;
|
||||
if ( isset( $sportspress_options['text'] ) ):
|
||||
foreach( $sportspress_options['text'] as $key => $value ):
|
||||
if ( $translated_text == $key ):
|
||||
$translated_text = $value;
|
||||
endif;
|
||||
endforeach;
|
||||
endif;
|
||||
endif;
|
||||
|
||||
return $translated_text;
|
||||
|
||||
@@ -10,40 +10,39 @@ function sportspress_define_globals() {
|
||||
global $sportspress_text_options;
|
||||
|
||||
$sportspress_text_options = array(
|
||||
'Calendar',
|
||||
'Calendars',
|
||||
'Current Team',
|
||||
'Event',
|
||||
'Events',
|
||||
'Friendly',
|
||||
'League',
|
||||
'Leagues',
|
||||
'League Table',
|
||||
'League Tables',
|
||||
'Nationality',
|
||||
'Number',
|
||||
'Past Teams',
|
||||
'Played',
|
||||
'Player',
|
||||
'Players',
|
||||
'Player List',
|
||||
'Player Lists',
|
||||
'Position',
|
||||
'Positions',
|
||||
'Pos',
|
||||
'Rank',
|
||||
'Roster',
|
||||
'Schedule',
|
||||
'Season',
|
||||
'Seasons',
|
||||
'Staff',
|
||||
'Substitute',
|
||||
'Team',
|
||||
'Teams',
|
||||
'Venue',
|
||||
'Venues',
|
||||
__( 'Article', 'sportspress' ),
|
||||
__( 'Current Team', 'sportspress' ),
|
||||
__( 'Date', 'sportspress' ),
|
||||
__( 'Details', 'sportspress' ),
|
||||
__( 'days', 'sportspress' ),
|
||||
__( 'Event', 'sportspress' ),
|
||||
__( 'Friendly', 'sportspress' ),
|
||||
__( 'hrs', 'sportspress' ),
|
||||
__( 'League', 'sportspress' ),
|
||||
__( 'mins', 'sportspress' ),
|
||||
__( 'Nationality', 'sportspress' ),
|
||||
__( 'Past Teams', 'sportspress' ),
|
||||
__( 'Player', 'sportspress' ),
|
||||
__( 'Position', 'sportspress' ),
|
||||
__( 'Pos', 'sportspress' ),
|
||||
__( 'Preview', 'sportspress' ),
|
||||
__( 'Rank', 'sportspress' ),
|
||||
__( 'Recap', 'sportspress' ),
|
||||
__( 'Results', 'sportspress' ),
|
||||
__( 'Season', 'sportspress' ),
|
||||
__( 'secs', 'sportspress' ),
|
||||
__( 'Staff', 'sportspress' ),
|
||||
__( 'Substitute', 'sportspress' ),
|
||||
__( 'Team', 'sportspress' ),
|
||||
__( 'Teams', 'sportspress' ),
|
||||
__( 'Time', 'sportspress' ),
|
||||
__( 'Total', 'sportspress' ),
|
||||
__( 'Venue', 'sportspress' ),
|
||||
__( 'View all players', 'sportspress' ),
|
||||
__( 'View all events', 'sportspress' ),
|
||||
__( 'View full table', 'sportspress' ),
|
||||
);
|
||||
|
||||
|
||||
sort( $sportspress_text_options );
|
||||
|
||||
// Continents
|
||||
|
||||
@@ -24,7 +24,7 @@ class SportsPressTextSettingsPage {
|
||||
foreach ( $this->strings as $string ):
|
||||
add_settings_field(
|
||||
sanitize_title( $string ),
|
||||
__( $string, 'sportspress' ),
|
||||
$string,
|
||||
array( $this, 'text_callback' ),
|
||||
'sportspress_text',
|
||||
'text'
|
||||
@@ -35,9 +35,8 @@ class SportsPressTextSettingsPage {
|
||||
public function text_callback( $test ) {
|
||||
$string = array_shift( $this->strings );
|
||||
$key = sanitize_title( $string );
|
||||
$localized = $string;
|
||||
$text = sportspress_array_value( sportspress_array_value( $this->options, 'text', array() ), $string, null );
|
||||
?><fieldset><input id="sportspress_text_<?php echo $key; ?>" name="sportspress[text][<?php echo $string; ?>]" type="text" class="regular-text" value="<?php echo $text; ?>" placeholder="<?php echo $localized; ?>"></fieldset><?php
|
||||
?><fieldset><input id="sportspress_text_<?php echo $key; ?>" name="sportspress[text][<?php echo $string; ?>]" type="text" class="regular-text" value="<?php echo $text; ?>" placeholder="<?php echo $string; ?>"></fieldset><?php
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user