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:
parent
b27d7ad9b0
commit
6a79affc88
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user