From 9cdf00abd0be73d4958972b5f70ce33fd64b0cba Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Fri, 28 Mar 2014 23:30:45 +1100 Subject: [PATCH] Adjust string function to output unsanitized string and only for non admin --- includes/class-sp-text.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/includes/class-sp-text.php b/includes/class-sp-text.php index 07897d46..9592a6f2 100644 --- a/includes/class-sp-text.php +++ b/includes/class-sp-text.php @@ -57,6 +57,7 @@ class SP_Text { 'current_team' => __( 'Current Team', 'sportspress' ), 'past_teams' => __( 'Past Teams', 'sportspress' ), 'rank' => __( 'Rank', 'sportspress' ), + 'played' => __( 'Played', 'sportspress' ), 'view_all_players' => __( 'View all players', 'sportspress' ), ), 'staff' => array( @@ -73,8 +74,11 @@ class SP_Text { $this->data[ $key ] = $value; } - public function string( $key, $context = null ){ - $key = str_replace( '-', '_', sanitize_title( $key ) ); + public function string( $string, $context = null ){ + if ( is_admin() ) + return $string; + + $key = str_replace( '-', '_', sanitize_title( $string ) ); if ( $context == null ) $context = 'general'; @@ -83,7 +87,7 @@ class SP_Text { $string = get_option( 'sportspress_' . ( $context == 'general' ? '' : $context . '_' ) . $key . '_text' ); return ( empty( $string ) ? $this->data[ $context ][ $key ] : $string ); else: - return $key; + return $string; endif; } }