Make WordPress Core

Changeset 24015


Ignore:
Timestamp:
04/17/2013 05:49:44 PM (11 years ago)
Author:
markjaquith
Message:

Use get_post_format() instead of assuming we already have it.

  • Fixes an issue where image posts without a title could not be deleted

fixes #23887. see #24046. props WraithKenny, SergeyBiryukov.

File:
1 edited

Legend:

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

    r23986 r24015  
    26562656    }
    26572657
    2658     if ( empty( $post_format ) )
    2659         $post_format = '';
    2660 
    26612658    $maybe_empty = ! $post_content && ! $post_title && ! $post_excerpt && post_type_supports( $post_type, 'editor' )
    26622659        && post_type_supports( $post_type, 'title' ) && post_type_supports( $post_type, 'excerpt' )
    2663         && ! in_array( $post_format, array( 'audio', 'video', 'quote', 'image' ) );
     2660        && ! in_array( get_post_format( $post_ID ), array( 'audio', 'video', 'quote', 'image' ) );
    26642661
    26652662    if ( apply_filters( 'wp_insert_post_empty_content', $maybe_empty, $postarr ) ) {
Note: See TracChangeset for help on using the changeset viewer.