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. git-svn-id: http://core.svn.wordpress.org/trunk@23404 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
fbfa656d6b
commit
f8cc93b62e
|
@ -169,14 +169,14 @@ require_once( './admin-header.php' );
|
||||||
$identical = true;
|
$identical = true;
|
||||||
foreach ( _wp_post_revision_fields() as $field => $field_title ) :
|
foreach ( _wp_post_revision_fields() as $field => $field_title ) :
|
||||||
if ( 'diff' == $action ) {
|
if ( 'diff' == $action ) {
|
||||||
$left_content = apply_filters( "_wp_post_revision_field_$field", $left_revision->$field, $field );
|
$left_content = apply_filters( "_wp_post_revision_field_$field", $left_revision->$field, $field, $left_revision, 'left' );
|
||||||
$right_content = apply_filters( "_wp_post_revision_field_$field", $right_revision->$field, $field );
|
$right_content = apply_filters( "_wp_post_revision_field_$field", $right_revision->$field, $field, $right_revision, 'right' );
|
||||||
if ( !$content = wp_text_diff( $left_content, $right_content ) )
|
if ( !$content = wp_text_diff( $left_content, $right_content ) )
|
||||||
continue; // There is no difference between left and right
|
continue; // There is no difference between left and right
|
||||||
$identical = false;
|
$identical = false;
|
||||||
} else {
|
} else {
|
||||||
add_filter( "_wp_post_revision_field_$field", 'htmlspecialchars' );
|
add_filter( "_wp_post_revision_field_$field", 'htmlspecialchars' );
|
||||||
$content = apply_filters( "_wp_post_revision_field_$field", $revision->$field, $field );
|
$content = apply_filters( "_wp_post_revision_field_$field", $revision->$field, $field, $revision, '' );
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue