_wp_post_revision_field_post_content хук-фильтрWP 3.6.0

Contextually filter a post revision field.

Это один из вариантов динамического хука _wp_post_revision_field_(field)

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

add_filter( '_wp_post_revision_field_post_content', 'wp_kama__wp_post_revision_field_content_filter', 10, 4 );

/**
 * Function for `_wp_post_revision_field_post_content` filter-hook.
 * 
 * @param string  $revision_field The current revision field to compare to or from.
 * @param string  $field          The current revision field.
 * @param WP_Post $compare_from   The revision post object to compare to or from.
 * @param string  $context        The context of whether the current revision is the old or the new one. Values are 'to' or 'from'.
 *
 * @return string
 */
function wp_kama__wp_post_revision_field_content_filter( $revision_field, $field, $compare_from, $context ){

	// filter...
	return $revision_field;
}
$revision_field(строка)
The current revision field to compare to or from.
$field(строка)
The current revision field.
$compare_from(WP_Post)
The revision post object to compare to or from.
$context(строка)
The context of whether the current revision is the old or the new one. Values are 'to' or 'from'.

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

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

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

wp_get_revision_ui_diff()
_wp_post_revision_field_post_content
wp-admin/includes/revision.php 90
$content_from = $compare_from ? apply_filters( "_wp_post_revision_field_{$field}", $compare_from->$field, $field, $compare_from, 'from' ) : '';

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

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