Make WordPress Core


Ignore:
Timestamp:
10/07/2015 09:52:18 PM (9 years ago)
Author:
johnbillion
Message:

Pass the $post parameter to the _wp_post_revision_fields filter. This provides more context to the filter, which allows for different fields to be displayed on the revisions screen depending on the post.

The _wp_post_revision_fields() function now also accepts a WP_Post object (in addition to an array of post fields) to facilitate this change.

Fixes #13382
Props adamsilverstein

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/post.php

    r34833 r34917  
    16571657        $post = get_post( $post_id );
    16581658        $autosave_is_different = false;
    1659         foreach ( array_intersect( array_keys( $new_autosave ), array_keys( _wp_post_revision_fields() ) ) as $field ) {
     1659        foreach ( array_intersect( array_keys( $new_autosave ), array_keys( _wp_post_revision_fields( $post ) ) ) as $field ) {
    16601660            if ( normalize_whitespace( $new_autosave[ $field ] ) != normalize_whitespace( $post->$field ) ) {
    16611661                $autosave_is_different = true;
Note: See TracChangeset for help on using the changeset viewer.