Changeset 24388 for trunk/wp-admin/includes/post.php
- Timestamp:
- 05/30/2013 09:33:46 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/post.php
r24304 r24388 1291 1291 $new_autosave['post_author'] = $post_author; 1292 1292 1293 // Auto-save revisioned meta fields.1294 foreach ( _wp_post_revision_meta_keys() as $meta_key ) {1295 if ( isset( $_POST[ $meta_key ] ) && get_post_meta( $new_autosave['ID'], $meta_key, true ) != $_POST[ $meta_key ] ) {1296 // Use the underlying delete_metadata and add_metadata vs delete_post_meta1297 // and add_post_meta to make sure we're working with the actual revision meta.1298 delete_metadata( 'post', $new_autosave['ID'], $meta_key );1299 1300 if ( ! empty( $_POST[ $meta_key ] ) )1301 add_metadata( 'post', $new_autosave['ID'], $meta_key, $_POST[ $meta_key ] );1302 }1303 }1304 1305 // Save the post format if different1306 if ( isset( $_POST['post_format'] ) && get_post_meta( $new_autosave['ID'], '_revision_post_format', true ) != $_POST['post_format'] ) {1307 delete_metadata( 'post', $new_autosave['ID'], '_revision_post_format' );1308 1309 if ( ! empty( $_POST['post_format'] ) )1310 add_metadata( 'post', $new_autosave['ID'], '_revision_post_format', $_POST['post_format'] );1311 }1312 1313 1293 return wp_update_post( $new_autosave ); 1314 1294 }
Note: See TracChangeset
for help on using the changeset viewer.