Ticket #17895: 17895-set-change.diff
File 17895-set-change.diff, 696 bytes (added by , 13 years ago) |
---|
-
post.php
5179 5179 function set_post_thumbnail( $post, $thumbnail_id ) { 5180 5180 $post = get_post( $post ); 5181 5181 $thumbnail_id = absint( $thumbnail_id ); 5182 if ( $post && $thumbnail_id && get_post( $thumbnail_id ) ) { 5182 if ( $post && $thumbnail_id == 0 ) { 5183 delete_post_meta( $post->ID, '_thumbnail_id' ); 5184 } else if ( $post && $thumbnail_id && get_post( $thumbnail_id ) ) { 5183 5185 $thumbnail_html = wp_get_attachment_image( $thumbnail_id, 'thumbnail' ); 5184 5186 if ( ! empty( $thumbnail_html ) ) { 5185 5187 update_post_meta( $post->ID, '_thumbnail_id', $thumbnail_id );