diff --git a/wp-admin/includes/meta-boxes.php b/wp-admin/includes/meta-boxes.php index becfbd3db2..8d71d02e72 100644 --- a/wp-admin/includes/meta-boxes.php +++ b/wp-admin/includes/meta-boxes.php @@ -158,11 +158,13 @@ echo esc_html( $visibility_trans ); ?> if ( 'post' == $post->post_type && current_theme_supports( 'post-formats' ) ) : $post_formats = get_theme_support( 'post-formats' ); +$post_formats_display = get_post_format_strings(); + if ( is_array( $post_formats[0] ) ) : $post_format = get_post_format( $post->ID ); if ( !$post_format ) $post_format = '0'; - $post_format_display = ( $post_format ) ? $post_format : __('Default'); + $post_format_display = $post_formats_display[$post_format]; ?>
@@ -173,7 +175,7 @@ if ( is_array( $post_formats[0] ) ) : diff --git a/wp-includes/post.php b/wp-includes/post.php index 7fb95180d9..2927b71878 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -5212,4 +5212,24 @@ function wp_quickpress_form( $args = array(), $post_type = 'post'){ endif; } +/** + * Returns an array of post format slugs to their translated and pretty display versions + * + * @return array The array of translations + */ +function get_post_format_strings() { + $strings = array( + '0' => _x( 'Default', 'Post format' ), + 'aside' => _x( 'Aside', 'Post format' ), + 'chat' => _x( 'Chat', 'Post format' ), + 'gallery' => _x( 'Gallery', 'Post format' ), + 'link' => _x( 'Link', 'Post format' ), + 'image' => _x( 'Image', 'Post format' ), + 'quote' => _x( 'Quote', 'Post format' ), + 'status' => _x( 'Status', 'Post format' ), + 'video' => _x( 'Video', 'Post format' ) + ); + return apply_filters( 'post_format_strings', $strings ); +} + ?>