Changeset 12007 for trunk/wp-admin/admin-ajax.php
- Timestamp:
- 10/07/2009 10:18:09 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-ajax.php
r11986 r12007 1371 1371 die(); 1372 1372 break; 1373 case 'set-post-thumbnail': 1374 $post_id = intval( $_POST['post_id'] ); 1375 if ( !current_user_can( 'edit_post', $post_id ) ) 1376 die( '-1' ); 1377 $thumbnail_id = intval( $_POST['thumbnail_id'] ); 1378 if ( $thumbnail_id && get_post( $thumbnail_id ) ) { 1379 $thumbnail_html = wp_get_attachment_image( $thumbnail_id, 'thumbnail' ); 1380 if ( !empty( $thumbnail_html ) ) { 1381 update_post_meta( $post_id, '_thumbnail_id', $thumbnail_id ); 1382 die( _wp_post_thumbnail_html( $thumbnail_id ) ); 1383 } 1384 } 1385 die( '0' ); 1373 1386 default : 1374 1387 do_action( 'wp_ajax_' . $_POST['action'] );
Note: See TracChangeset
for help on using the changeset viewer.