WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/06/2012 08:49:35 AM (9 years ago)
Author:
koopersmith
Message:

First pass at integrating featured images with the new media workflow.

Updates the featured image when the publish/update button is clicked (rather than instantly). Uses the existing post_thumbnail_meta_box() function. Does not remove the old featured image meta box JS, ajax handler, or CSS.

see #21776, #21390.

File:
1 edited

Legend:

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

    r21735 r21770  
    197197        elseif ( '0' == $post_data['post_format'] )
    198198            set_post_format( $post_ID, false );
     199    }
     200
     201    // Featured Images
     202    if ( isset( $post_data['thumbnail_id'] ) ) {
     203        if ( '-1' == $post_data['thumbnail_id'] )
     204            delete_post_thumbnail( $post_ID );
     205        else
     206            set_post_thumbnail( $post_ID, $post_data['thumbnail_id'] );
    199207    }
    200208
Note: See TracChangeset for help on using the changeset viewer.