Ticket #6775: 6775.5.diff
File 6775.5.diff, 2.3 KB (added by , 17 years ago) |
---|
-
wp-includes/post.php
957 957 $wpdb->update( $wpdb->posts, $parent_data, $parent_where + array( 'post_type' => 'page' ) ); 958 958 } 959 959 960 // Do raw query. wp_get_post_revisions() is filtered 961 $revision_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'revision'", $postid ) ); 962 // Use wp_delete_post (via wp_delete_revision) again. Ensures any meta/misplaced data gets cleaned up. 963 foreach ( $revision_ids as $revision_id ) 964 wp_delete_revision( $revision_id ); 965 960 966 // Point all attachments to this post up one level 961 967 $wpdb->update( $wpdb->posts, $parent_data, $parent_where + array( 'post_type' => 'attachment' ) ); 962 968 … … 3022 3028 if ( @constant( 'DOING_AUTOSAVE' ) ) 3023 3029 return; 3024 3030 3031 if ( !constant('WP_POST_REVISIONS') ) 3032 return; 3033 3025 3034 if ( !$post = get_post( $post_id, ARRAY_A ) ) 3026 3035 return; 3027 3036 … … 3227 3236 * @return array empty if no revisions 3228 3237 */ 3229 3238 function wp_get_post_revisions( $post_id = 0 ) { 3239 if ( !constant('WP_POST_REVISIONS') ) 3240 return array(); 3230 3241 if ( ( !$post = get_post( $post_id ) ) || empty( $post->ID ) ) 3231 3242 return array(); 3232 3243 if ( !$revisions = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'revision', 'post_status' => 'inherit' ) ) ) -
wp-settings.php
376 376 377 377 do_action('plugins_loaded'); 378 378 379 $default_constants = array( 'WP_POST_REVISIONS' => true ); 380 foreach ( $default_constants as $c => $v ) 381 @define( $c, $v ); // will fail if the constant is already defined 382 unset($default_constants, $c, $v); 383 379 384 // If already slashed, strip. 380 385 if ( get_magic_quotes_gpc() ) { 381 386 $_GET = stripslashes_deep($_GET ); -
wp-admin/revision.php
2 2 3 3 require_once('admin.php'); 4 4 5 if ( !constant('WP_POST_REVISIONS') ) { 6 wp_redirect( 'edit.php' ); 7 exit; 8 } 9 5 10 wp_reset_vars(array('revision', 'left', 'right', 'action')); 6 11 $revision_id = absint($revision); 7 12 $diff = absint($diff);