Fix bugs, use plural post slugs, move actions and filters into hooks folder

This commit is contained in:
Brian Miyaji
2014-01-09 02:37:13 +11:00
parent e76d392726
commit bfcf6e9b38
32 changed files with 390 additions and 312 deletions

View File

@@ -0,0 +1,26 @@
<?php
function sportspress_admin_post_thumbnail_html( $translated_text, $post_id ) {
$texts = array(
'sp_team' => array(
'Set featured image' => 'Select Logo',
'Remove featured image' => 'Remove Logo',
),
'sp_player' => array(
'Set featured image' => 'Select Photo',
'Remove featured image' => 'Remove Photo',
),
'sp_staff' => array(
'Set featured image' => 'Select Photo',
'Remove featured image' => 'Remove Photo',
),
);
$typenow = get_post_type( $post_id );
if ( is_admin() && array_key_exists( $typenow, $texts ) ):
foreach ( $texts[ $typenow ] as $key => $value ):
$translated_text = str_replace( __( $key ), __( $value, 'sportspress' ), $translated_text );
endforeach;
endif;
return $translated_text;
}
add_filter( 'admin_post_thumbnail_html', 'sportspress_admin_post_thumbnail_html', 10, 2 );