Changeset 21967 for trunk/wp-includes/post.php
- Timestamp:
- 09/24/2012 01:07:34 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post.php
r21953 r21967 208 208 209 209 $file = apply_filters( 'update_attached_file', $file, $attachment_id ); 210 $file = _wp_relative_upload_path($file); 211 212 return update_post_meta( $attachment_id, '_wp_attached_file', $file ); 210 if ( $file = _wp_relative_upload_path( $file ) ) 211 return update_post_meta( $attachment_id, '_wp_attached_file', $file ); 212 else 213 return delete_post_meta( $attachment_id, '_wp_attached_file' ); 213 214 } 214 215 … … 4029 4030 return false; 4030 4031 4031 $data = apply_filters( 'wp_update_attachment_metadata', $data, $post->ID ); 4032 4033 return update_post_meta( $post->ID, '_wp_attachment_metadata', $data); 4032 if ( $data = apply_filters( 'wp_update_attachment_metadata', $data, $post->ID ) ) 4033 return update_post_meta( $post->ID, '_wp_attachment_metadata', $data ); 4034 else 4035 return delete_post_meta( $post->ID, '_wp_attachment_metadata' ); 4034 4036 } 4035 4037 … … 5209 5211 $thumbnail_id = absint( $thumbnail_id ); 5210 5212 if ( $post && $thumbnail_id && get_post( $thumbnail_id ) ) { 5211 $thumbnail_html = wp_get_attachment_image( $thumbnail_id, 'thumbnail' ); 5212 if ( ! empty( $thumbnail_html ) ) { 5213 if ( $thumbnail_html = wp_get_attachment_image( $thumbnail_id, 'thumbnail' ) ) 5213 5214 return update_post_meta( $post->ID, '_thumbnail_id', $thumbnail_id ); 5214 } 5215 else 5216 return delete_post_meta( $post->ID, '_thumbnail_id' ); 5215 5217 } 5216 5218 return false;
Note: See TracChangeset
for help on using the changeset viewer.