wp_get_revision_ui_diff

Filters the fields displayed in the post revision diff UI.

Description

apply_filters( 'wp_get_revision_ui_diff', (array) $return, (WP_Post) $compare_from, (WP_Post) $compare_to ); 

Parameters (3)

0. $return (array)
Revision UI fields. Each item is an array of id, name and diff.
1. $compare_from (WP_Post)
The revision post to compare from.
2. $compare_to (WP_Post)
The revision post to compare to.

Usage

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

Defined (1)

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

/wp-admin/includes/revision.php  
  1. return apply_filters( 'wp_get_revision_ui_diff', $return, $compare_from, $compare_to );