WordPress.org

Make WordPress Core

Changeset 14731


Ignore:
Timestamp:
05/18/10 22:14:52 (4 years ago)
Author:
markjaquith
Message:

Correctly set Featured Post Image link after removing/updating. fixes #13033. props PotterSys

File:
1 edited

Legend:

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

    r14730 r14731  
    14631463    break; 
    14641464case 'set-post-thumbnail': 
    1465     $post_id = intval( $_POST['post_id'] ); 
    1466     if ( !current_user_can( 'edit_post', $post_id ) ) 
     1465    $post_ID = intval( $_POST['post_id'] ); 
     1466    if ( !current_user_can( 'edit_post', $post_ID ) ) 
    14671467        die( '-1' ); 
    14681468    $thumbnail_id = intval( $_POST['thumbnail_id'] ); 
    14691469 
    1470     check_ajax_referer( "set_post_thumbnail-$post_id" ); 
     1470    check_ajax_referer( "set_post_thumbnail-$post_ID" ); 
    14711471 
    14721472    if ( $thumbnail_id == '-1' ) { 
    1473         delete_post_meta( $post_id, '_thumbnail_id' ); 
     1473        delete_post_meta( $post_ID, '_thumbnail_id' ); 
    14741474        die( _wp_post_thumbnail_html() ); 
    14751475    } 
     
    14781478        $thumbnail_html = wp_get_attachment_image( $thumbnail_id, 'thumbnail' ); 
    14791479        if ( !empty( $thumbnail_html ) ) { 
    1480             update_post_meta( $post_id, '_thumbnail_id', $thumbnail_id ); 
     1480            update_post_meta( $post_ID, '_thumbnail_id', $thumbnail_id ); 
    14811481            die( _wp_post_thumbnail_html( $thumbnail_id ) ); 
    14821482        } 
Note: See TracChangeset for help on using the changeset viewer.