revision_text_diff_options

Filters revisions text diff options.

Description

apply_filters( 'revision_text_diff_options', (array) $args, (string) $field, (WP_Post) $compare_from, (WP_Post) $compare_to ); 

Filters the options passed to wp_text_diff() when viewing a post revision.

Parameters (4)

0. $args (array)
1. $field (string)
The current revision field.
2. $compare_from (WP_Post)
The revision post to compare from.
3. $compare_to (WP_Post)
The revision post to compare to.

Usage

To run the hook, copy the example below.
  1. $args = apply_filters( 'revision_text_diff_options', $args, $field, $compare_from, $compare_to ); 
  2.  
  3. if ( !empty( $args ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the revision_text_diff_options callback 
  2. function filter_revision_text_diff_options( $args, $field, $compare_from, $compare_to ) { 
  3. // make filter magic happen here... 
  4. return $args
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'revision_text_diff_options', 'filter_revision_text_diff_options', 10, 4 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'revision_text_diff_options', 'filter_revision_text_diff_options', 10, 4 ); 

Defined (1)

The filter is defined in the following location(s).

/wp-admin/includes/revision.php  
  1. $args = apply_filters( 'revision_text_diff_options', $args, $field, $compare_from, $compare_to );