Make WordPress Core


Ignore:
Timestamp:
02/24/2016 12:43:31 AM (10 years ago)
Author:
SergeyBiryukov
Message:

Revisions: Clean up _wp_post_revision_fields():

  • Move the array processing to a new function, _wp_post_revision_data().
  • Make both functions accept a post array or a WP_Post object.
  • Always apply the _wp_post_revision_fields filter and pass the post data to it.

Fixes #13382.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/edit-form-advanced.php

    r35883 r36659  
    198198// Detect if there exists an autosave newer than the post and if that autosave is different than the post
    199199if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt, false ) > mysql2date( 'U', $post->post_modified_gmt, false ) ) {
    200         foreach ( _wp_post_revision_fields() as $autosave_field => $_autosave_field ) {
     200        foreach ( _wp_post_revision_fields( $post ) as $autosave_field => $_autosave_field ) {
    201201                if ( normalize_whitespace( $autosave->$autosave_field ) != normalize_whitespace( $post->$autosave_field ) ) {
    202202                        $notice = sprintf( __( 'There is an autosave of this post that is more recent than the version below. <a href="%s">View the autosave</a>' ), get_edit_post_link( $autosave->ID ) );
Note: See TracChangeset for help on using the changeset viewer.