Ticket #7237: 7237.diff
| File 7237.diff, 1.4 KB (added by mdawaffe, 5 years ago) |
|---|
-
wp-includes/post.php
1218 1218 $defaults = array('post_status' => 'draft', 'post_type' => 'post', 'post_author' => $user_ID, 1219 1219 'ping_status' => get_option('default_ping_status'), 'post_parent' => 0, 1220 1220 'menu_order' => 0, 'to_ping' => '', 'pinged' => '', 'post_password' => '', 1221 'guid' => '', 'post_content_filtered' => '', 'post_excerpt' => '' );1221 'guid' => '', 'post_content_filtered' => '', 'post_excerpt' => '', 'clean_cache' => true ); 1222 1222 1223 1223 $postarr = wp_parse_args($postarr, $defaults); 1224 1224 $postarr = sanitize_post($postarr, 'db'); … … 1381 1381 1382 1382 $current_guid = get_post_field( 'guid', $post_ID ); 1383 1383 1384 if ( 'page' == $post_type ) 1385 clean_page_cache($post_ID); 1386 else 1387 clean_post_cache($post_ID); 1384 if ( $clean_cache ) { 1385 if ( 'page' == $post_type ) 1386 clean_page_cache($post_ID); 1387 else 1388 clean_post_cache($post_ID); 1389 } 1388 1390 1389 1391 // Set GUID 1390 1392 if ( !$update && '' == $current_guid ) … … 3297 3299 if ( isset($post['post_type']) && 'revision' == $post_post['type'] ) 3298 3300 return new WP_Error( 'post_type', __( 'Cannot create a revision of a revision' ) ); 3299 3301 3302 // In current implemenation, we're always inserting a new row without taxonomy or meta 3303 $post['clean_cache'] = false; 3300 3304 $post = _wp_post_revision_fields( $post, $autosave ); 3301 3305 3302 3306 $revision_id = wp_insert_post( $post );
