Funnel unknown values to blank (standard) post format in set_post_format()

git-svn-id: https://develop.svn.wordpress.org/trunk@17224 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith 2011-01-05 22:26:55 +00:00
parent b27d7ad9b0
commit 6a79affc88
1 changed files with 1 additions and 2 deletions

View File

@ -528,8 +528,7 @@ function set_post_format( $post, $format ) {
if ( !empty($format) ) {
$format = sanitize_key($format);
$empty_formats = array( 'post', 'standard' );
if ( in_array( $format, $empty_formats ) )
if ( 'standard' == $format || !in_array( $format, array_keys( get_post_format_slugs() ) ) )
$format = '';
else
$format = 'post-format-' . $format;