Ticket #11703: 11703.diff
| File 11703.diff, 1.4 KB (added by , 16 years ago) |
|---|
-
wp-includes/post.php
15 15 * Creates the initial post types when 'init' action is fired. 16 16 */ 17 17 function create_initial_post_types() { 18 register_post_type( 'post', array('exclude_from_search' => false ) );19 register_post_type( 'page', array('exclude_from_search' => false ) );18 register_post_type( 'post', array('exclude_from_search' => false, 'revisions' => true) ); 19 register_post_type( 'page', array('exclude_from_search' => false, 'revisions' => true) ); 20 20 register_post_type( 'attachment', array('exclude_from_search' => false) ); 21 21 register_post_type( 'revision', array('exclude_from_search' => true) ); 22 22 } … … 3728 3728 if ( !$post = get_post( $post_id, ARRAY_A ) ) 3729 3729 return; 3730 3730 3731 if ( !in_array( $post['post_type'], array( 'post', 'page') ) )3731 if ( !in_array( $post['post_type'], get_post_types( array('revisions' => true) ) ) ) 3732 3732 return; 3733 3733 3734 3734 $return = _wp_put_post_revision( $post ); … … 3740 3740 // all revisions and (possibly) one autosave 3741 3741 $revisions = wp_get_post_revisions( $post_id, array( 'order' => 'ASC' ) ); 3742 3742 3743 // WP_POST_REVISIONS = (int) (# of aut asaves to save)3743 // WP_POST_REVISIONS = (int) (# of autosaves to save) 3744 3744 $delete = count($revisions) - WP_POST_REVISIONS; 3745 3745 3746 3746 if ( $delete < 1 )