From ac0f742bea4881f0783b04e0b41e31a10623a125 Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Sat, 20 Aug 2016 23:08:30 +1000 Subject: [PATCH] Use native labels for custom featured image text --- includes/class-sp-post-types.php | 16 +++++++++++ includes/sp-template-hooks.php | 46 -------------------------------- 2 files changed, 16 insertions(+), 46 deletions(-) diff --git a/includes/class-sp-post-types.php b/includes/class-sp-post-types.php index 7f3161ff..1f5d9fbe 100644 --- a/includes/class-sp-post-types.php +++ b/includes/class-sp-post-types.php @@ -357,6 +357,10 @@ class SP_Post_types { 'search_items' => __( 'Search', 'sportspress' ), 'not_found' => __( 'No results found.', 'sportspress' ), 'not_found_in_trash' => __( 'No results found.', 'sportspress' ), + 'featured_image' => __( 'Icon', 'sportspress' ), + 'set_featured_image' => __( 'Select Icon', 'sportspress' ), + 'remove_featured_image' => __( 'Remove icon', 'sportspress' ), + 'use_featured_image' => __( 'Add icon', 'sportspress' ), ), 'public' => false, 'show_ui' => true, @@ -453,6 +457,10 @@ class SP_Post_types { 'search_items' => __( 'Search', 'sportspress' ), 'not_found' => __( 'No results found.', 'sportspress' ), 'not_found_in_trash' => __( 'No results found.', 'sportspress' ), + 'featured_image' => __( 'Logo', 'sportspress' ), + 'set_featured_image' => __( 'Select Logo', 'sportspress' ), + 'remove_featured_image' => __( 'Remove Logo', 'sportspress' ), + 'use_featured_image' => __( 'Select Logo', 'sportspress' ), ), 'public' => true, 'show_ui' => true, @@ -486,6 +494,10 @@ class SP_Post_types { 'search_items' => __( 'Search', 'sportspress' ), 'not_found' => __( 'No results found.', 'sportspress' ), 'not_found_in_trash' => __( 'No results found.', 'sportspress' ), + 'featured_image' => __( 'Photo', 'sportspress' ), + 'set_featured_image' => __( 'Select Photo', 'sportspress' ), + 'remove_featured_image' => __( 'Remove Photo', 'sportspress' ), + 'use_featured_image' => __( 'Select Photo', 'sportspress' ), ), 'public' => true, 'show_ui' => true, @@ -519,6 +531,10 @@ class SP_Post_types { 'search_items' => __( 'Search', 'sportspress' ), 'not_found' => __( 'No results found.', 'sportspress' ), 'not_found_in_trash' => __( 'No results found.', 'sportspress' ), + 'featured_image' => __( 'Photo', 'sportspress' ), + 'set_featured_image' => __( 'Select Photo', 'sportspress' ), + 'remove_featured_image' => __( 'Remove Photo', 'sportspress' ), + 'use_featured_image' => __( 'Select Photo', 'sportspress' ), ), 'public' => true, 'show_ui' => true, diff --git a/includes/sp-template-hooks.php b/includes/sp-template-hooks.php index 7c4616e9..e02309e7 100644 --- a/includes/sp-template-hooks.php +++ b/includes/sp-template-hooks.php @@ -173,18 +173,6 @@ function sportspress_gettext( $translated_text, $untranslated_text, $domain = nu case 'Slug': $translated_text = ( in_array( $typenow, array( 'sp_column', 'sp_statistic' ) ) ) ? __( 'Key', 'sportspress' ) : __( 'Variable', 'sportspress' ); break; - case 'Featured Image': - $translated_text = __( 'Icon', 'sportspress' ); - break; - case 'Set Featured Image': - $translated_text = __( 'Select Icon', 'sportspress' ); - break; - case 'Set featured image': - $translated_text = __( 'Add icon', 'sportspress' ); - break; - case 'Remove featured image': - $translated_text = __( 'Remove icon', 'sportspress' ); - break; endswitch; endif; @@ -196,40 +184,6 @@ function sportspress_gettext( $translated_text, $untranslated_text, $domain = nu endswitch; endif; - if ( in_array( $typenow, array( 'sp_player', 'sp_staff' ) ) ): - switch ( $untranslated_text ): - case 'Featured Image': - $translated_text = __( 'Photo', 'sportspress' ); - break; - case 'Set Featured Image': - $translated_text = __( 'Select Photo', 'sportspress' ); - break; - case 'Set featured image': - $translated_text = __( 'Add photo', 'sportspress' ); - break; - case 'Remove featured image': - $translated_text = __( 'Remove photo', 'sportspress' ); - break; - endswitch; - endif; - - if ( in_array( $typenow, array( 'sp_team' ) ) ): - switch ( $untranslated_text ): - case 'Featured Image': - $translated_text = __( 'Logo', 'sportspress' ); - break; - case 'Set Featured Image': - $translated_text = __( 'Select Logo', 'sportspress' ); - break; - case 'Set featured image': - $translated_text = __( 'Add logo', 'sportspress' ); - break; - case 'Remove featured image': - $translated_text = __( 'Remove logo', 'sportspress' ); - break; - endswitch; - endif; - if ( in_array( $typenow, array( 'sp_event' ) ) ): switch ( $untranslated_text ): case 'Publish immediately':