Adjust text options to modify front-end only

This commit is contained in:
Brian Miyaji
2014-03-22 12:57:47 +11:00
parent 019cb20c5f
commit 27e76e0ea8
3 changed files with 41 additions and 44 deletions

View File

@@ -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
}
}