revision_text_diff_options хук-фильтрWP 4.1.0

Filters revisions text diff options.

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

Использование

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(массив)

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).
    По умолчанию: true
$field(строка)
The current revision field.
$compare_from(WP_Post)
The revision post to compare from.
$compare_to(WP_Post)
The revision post to compare to.

Список изменений

С версии 4.1.0 Введена.

Где вызывается хук

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 );

Где используется хук в WordPress

Использование не найдено.