[wp-trac] [WordPress Trac] #24011: Consider hiding post title for "Status" and "Aside" formats and autogenerating

WordPress Trac noreply at wordpress.org
Thu Apr 25 05:20:19 UTC 2013


#24011: Consider hiding post title for "Status" and "Aside" formats and
autogenerating
----------------------------+--------------------
 Reporter:  markjaquith     |       Owner:
     Type:  task (blessed)  |      Status:  new
 Priority:  high            |   Milestone:  3.6
Component:  Post Formats    |     Version:  trunk
 Severity:  normal          |  Resolution:
 Keywords:  has-patch       |
----------------------------+--------------------

Comment (by MZAWeb):

 There's a regression introduced in [changeset:"24043"]

 In _post_formats_fix_empty_title():

 {{{
 $post_id = ( isset( $postarr['ID'] ) ) ? absint( $postarr['ID'] ) : 0;

 if ( $post_id )
         $post_format = get_post_format( $post_id );

 if ( isset( $postarr['post_format'] ) )
         $post_format = ( in_array( $postarr['post_format'],
 get_post_format_slugs() ) ) ? $postarr['post_format'] : '';

 if ( ! in_array( $post_format, array( 'aside', 'status' ) ) )
         return $data;

 }}}

 When you wp_insert_post() without passing a post_format, neither $post_id
 nor $postarr['post_format'] are set, so that $post_format in the last if
 throws a warning because it's undefined.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/24011#comment:23>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list