Make thumbnail texts independent

This commit is contained in:
Takumi
2013-07-26 00:24:42 +10:00
parent f0b3e72231
commit 1edf37c310
2 changed files with 18 additions and 3 deletions

View File

@@ -23,10 +23,10 @@ function sp_gettext( $translated_text, $untranslated_text, $domain ) {
add_filter( 'gettext', 'sp_gettext', 20, 3 );
function sp_admin_post_thumbnail_html( $translated_text, $post_id ) {
global $sportspress_texts;
global $sportspress_thumbnail_texts;
$typenow = get_post_type( $post_id );
if ( is_admin() && array_key_exists( $typenow, $sportspress_texts ) ):
foreach ( $sportspress_texts[ $typenow ] as $key => $value ):
if ( is_admin() && array_key_exists( $typenow, $sportspress_thumbnail_texts ) ):
foreach ( $sportspress_thumbnail_texts[ $typenow ] as $key => $value ):
$translated_text = str_replace( __( $key ), $value, $translated_text );
endforeach;
endif;

View File

@@ -38,6 +38,21 @@ $sportspress_texts = array(
)
);
$sportspress_thumbnail_texts = array(
'sp_team' => array(
'Set featured image' => sprintf( __( 'Add %s', 'sportspress' ), __( 'Logo', 'sportspress' ) ),
'Remove featured image' => sprintf( __( 'Remove %s', 'sportspress' ), __( 'Logo', 'sportspress' ) )
),
'sp_player' => array(
'Set featured image' => sprintf( __( 'Add %s', 'sportspress' ), __( 'Photo', 'sportspress' ) ),
'Remove featured image' => sprintf( __( 'Remove %s', 'sportspress' ), __( 'Photo', 'sportspress' ) )
),
'sp_staff' => array(
'Set featured image' => sprintf( __( 'Add %s', 'sportspress' ), __( 'Photo', 'sportspress' ) ),
'Remove featured image' => sprintf( __( 'Remove %s', 'sportspress' ), __( 'Photo', 'sportspress' ) )
)
);
foreach( $sportspress_options as $optiongroupkey => $optiongroup ) {
foreach( $optiongroup as $key => $value ) {
if ( get_option( $key ) === false )