Make WordPress Core


Ignore:
Timestamp:
12/01/2010 08:03:39 PM (16 years ago)
Author:
ryan
Message:

Prevent default post formats from entering the DB. see #15629 #15582

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post.php

    r16652 r16662  
    527527                return new WP_Error('invalid_post', __('Invalid post'));
    528528
    529         if ( !empty($format) )
    530                 $format = 'post-format-' . sanitize_key($format);
     529        if ( !empty($format) ) {
     530                $format = sanitize_key($format);
     531                $empty_formats = array( 'post', 'default' );
     532                if ( in_array( $format, $empty_formats ) )
     533                        $format = '';
     534                else
     535                        $format = 'post-format-' . $format;
     536        }
    531537
    532538        return wp_set_post_terms($post->ID, $format, 'post_format');
Note: See TracChangeset for help on using the changeset viewer.