revision_text_diff_options filter-hookWP 4.1.0

Filters revisions text diff options.

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

Usage

add_filter( 'revision_text_diff_options', 'wp_kama_revision_text_diff_options_filter', 10, 4 );

/**
 * Function for `revision_text_diff_options` filter-hook.
 * 
 * @param array   $args         Associative array of options to pass to wp_text_diff().
 * @param string  $field        The current revision field.
 * @param WP_Post $compare_from The revision post to compare from.
 * @param WP_Post $compare_to   The revision post to compare to.
 *
 * @return array
 */
function wp_kama_revision_text_diff_options_filter( $args, $field, $compare_from, $compare_to ){

	// filter...
	return $args;
}
$args(array)

Associative array of options to pass to wp_text_diff().

  • show_split_view(true|false)
    True for split view (two columns), false for un-split view (single column).
    Default: true
$field(string)
The current revision field.
$compare_from(WP_Post)
The revision post to compare from.
$compare_to(WP_Post)
The revision post to compare to.

Changelog

Since 4.1.0 Introduced.

Where the hook is called

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

Where the hook is used in WordPress

Usage not found.