Apply text settings via gettext

This commit is contained in:
Brian Miyaji
2014-03-18 23:37:27 +11:00
parent 2d55969554
commit 48924abf72
8 changed files with 61 additions and 35 deletions

View File

@@ -1,6 +1,9 @@
<?php
function sportspress_gettext( $translated_text, $untranslated_text, $domain ) {
global $typenow;
if ( $domain != 'sportspress' )
return $translated_text;
global $typenow, $sportspress_options;
if ( is_admin() ):
if ( in_array( $typenow, array( 'sp_team' ) ) ):
@@ -68,6 +71,14 @@ function sportspress_gettext( $translated_text, $untranslated_text, $domain ) {
endif;
endif;
endif;
if ( isset( $sportspress_options['text'] ) ):
foreach( $sportspress_options['text'] as $key => $value ):
if ( $untranslated_text == $key ):
$translated_text = $value;
endif;
endforeach;
endif;
return $translated_text;
}