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.
- $return = apply_filters( 'wp_get_revision_ui_diff', $return, $compare_from, $compare_to );
- if ( !empty( $return ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the wp_get_revision_ui_diff callback
- function filter_wp_get_revision_ui_diff( $return, $compare_from, $compare_to ) {
- // make filter magic happen here...
- return $return;
- };
- // add the filter
- add_filter( 'wp_get_revision_ui_diff', 'filter_wp_get_revision_ui_diff', 10, 3 );
- To remove a hook callback, use the example below.
- // remove the filter
- 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
- return apply_filters( 'wp_get_revision_ui_diff', $return, $compare_from, $compare_to );