Make WordPress Core


Ignore:
Timestamp:
02/13/2013 09:42:03 PM (12 years ago)
Author:
westi
Message:

Revisions: Pass the whole revision being filtered along with context about which side it is to the _wp_post_revision_field_$field filters.

Fixes #19932 props pollett, ethitter.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/revision.php

    r15910 r23404  
    170170foreach ( _wp_post_revision_fields() as $field => $field_title ) :
    171171    if ( 'diff' == $action ) {
    172         $left_content = apply_filters( "_wp_post_revision_field_$field", $left_revision->$field, $field );
    173         $right_content = apply_filters( "_wp_post_revision_field_$field", $right_revision->$field, $field );
     172        $left_content = apply_filters( "_wp_post_revision_field_$field", $left_revision->$field, $field, $left_revision, 'left' );
     173        $right_content = apply_filters( "_wp_post_revision_field_$field", $right_revision->$field, $field, $right_revision, 'right' );
    174174        if ( !$content = wp_text_diff( $left_content, $right_content ) )
    175175            continue; // There is no difference between left and right
     
    177177    } else {
    178178        add_filter( "_wp_post_revision_field_$field", 'htmlspecialchars' );
    179         $content = apply_filters( "_wp_post_revision_field_$field", $revision->$field, $field );
     179        $content = apply_filters( "_wp_post_revision_field_$field", $revision->$field, $field, $revision, '' );
    180180    }
    181181    ?>
Note: See TracChangeset for help on using the changeset viewer.