Make WordPress Core


Ignore:
Timestamp:
10/15/2009 12:57:16 PM (15 years ago)
Author:
markjaquith
Message:

Post thumbnail removal functionality (only allowed for replacement before). props scribu. see #10928

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-ajax.php

    r12023 r12036  
    13961396        die( '-1' );
    13971397    $thumbnail_id = intval( $_POST['thumbnail_id'] );
     1398
     1399    if ( $thumbnail_id == '-1' ) {
     1400        delete_post_meta( $post_id, '_thumbnail_id' );
     1401        die( _wp_post_thumbnail_html() );
     1402    }
     1403
    13981404    if ( $thumbnail_id && get_post( $thumbnail_id ) ) {
    13991405        $thumbnail_html = wp_get_attachment_image( $thumbnail_id, 'thumbnail' );
Note: See TracChangeset for help on using the changeset viewer.