From ee1ced6ba92e9fe51ae32fc2f9356d9cf298c794 Mon Sep 17 00:00:00 2001 From: markjaquith Date: Tue, 18 May 2010 22:14:52 +0000 Subject: [PATCH] Correctly set Featured Post Image link after removing/updating. fixes #13033. props PotterSys git-svn-id: http://svn.automattic.com/wordpress/trunk@14731 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/admin-ajax.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wp-admin/admin-ajax.php b/wp-admin/admin-ajax.php index 48a3c2fea..6adff5797 100644 --- a/wp-admin/admin-ajax.php +++ b/wp-admin/admin-ajax.php @@ -1462,22 +1462,22 @@ case 'image-editor': die(); break; case 'set-post-thumbnail': - $post_id = intval( $_POST['post_id'] ); - if ( !current_user_can( 'edit_post', $post_id ) ) + $post_ID = intval( $_POST['post_id'] ); + if ( !current_user_can( 'edit_post', $post_ID ) ) die( '-1' ); $thumbnail_id = intval( $_POST['thumbnail_id'] ); - check_ajax_referer( "set_post_thumbnail-$post_id" ); + check_ajax_referer( "set_post_thumbnail-$post_ID" ); if ( $thumbnail_id == '-1' ) { - delete_post_meta( $post_id, '_thumbnail_id' ); + delete_post_meta( $post_ID, '_thumbnail_id' ); die( _wp_post_thumbnail_html() ); } if ( $thumbnail_id && get_post( $thumbnail_id ) ) { $thumbnail_html = wp_get_attachment_image( $thumbnail_id, 'thumbnail' ); if ( !empty( $thumbnail_html ) ) { - update_post_meta( $post_id, '_thumbnail_id', $thumbnail_id ); + update_post_meta( $post_ID, '_thumbnail_id', $thumbnail_id ); die( _wp_post_thumbnail_html( $thumbnail_id ) ); } }