Changeset 23414
- Timestamp:
- 02/14/2013 11:36:32 AM (12 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/default-filters.php
r23355 r23414 250 250 add_action( 'plugins_loaded', 'wp_maybe_load_embeds', 0 ); 251 251 add_action( 'shutdown', 'wp_ob_end_flush_all', 1 ); 252 add_action( 'pre_post_update', 'wp_save_post_revision' 252 add_action( 'pre_post_update', 'wp_save_post_revision', 10, 2 ); 253 253 add_action( 'publish_post', '_publish_post_hook', 5, 1 ); 254 254 add_action( 'transition_post_status', '_transition_post_status', 5, 3 ); -
trunk/wp-includes/post.php
r23401 r23414 2867 2867 2868 2868 if ( $update ) { 2869 do_action( 'pre_post_update', $post_ID );2869 do_action( 'pre_post_update', $post_ID, $data ); 2870 2870 if ( false === $wpdb->update( $wpdb->posts, $data, $where ) ) { 2871 2871 if ( $wp_error ) … … 4930 4930 * @return mixed Null or 0 if error, new revision ID, if success. 4931 4931 */ 4932 function wp_save_post_revision( $post_id ) {4932 function wp_save_post_revision( $post_id, $new_data = null ) { 4933 4933 // We do autosaves manually with wp_create_post_autosave() 4934 4934 if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) … … 4947 4947 if ( !post_type_supports($post['post_type'], 'revisions') ) 4948 4948 return; 4949 4950 // if new data is supplied, check that it is different from last saved revision 4951 if( is_array( $new_data ) ) { 4952 $post_has_changed = false; 4953 foreach( array_keys( _wp_post_revision_fields() ) as $field ) { 4954 if( normalize_whitespace( $new_data[ $field ] ) != normalize_whitespace( $post[ $field ] ) ) { 4955 $post_has_changed = true; 4956 break; 4957 } 4958 } 4959 //don't save revision if post unchanged 4960 if( ! $post_has_changed ) 4961 return; 4962 } 4949 4963 4950 4964 $return = _wp_put_post_revision( $post );
Note: See TracChangeset
for help on using the changeset viewer.