wppaste
WordPress

apply_filters( "_wp_post_revision_field_{$field}", string $revision_field, string $field, WP_Post $compare_from, string $context )

Since
3.6.0
Contextually filter a post revision field.

Description

The dynamic portion of the hook name, $field, corresponds to a name of a field of the revision object.

Possible hook names include:

  • _wp_post_revision_field_post_title
  • _wp_post_revision_field_post_content
  • _wp_post_revision_field_post_excerpt

Compatibility

WordPress
since 3.6.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$revision_fieldstring
The current revision field to compare to or from.
$fieldstring
The current revision field.
$compare_fromWP_Post
The revision post object to compare to or from.
$contextstring
The context of whether the current revision is the old or the new one. Either 'to' or 'from'.

Where this hook fires · 2

  • wp-admin/includes/revision.php:90wp_get_revision_ui_diff()
  • wp-admin/includes/revision.php:93wp_get_revision_ui_diff()

Source code

		 * @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. Either 'to' or 'from'.		 */		$content_from = $compare_from ? apply_filters( "_wp_post_revision_field_{$field}", $compare_from->$field, $field, $compare_from, 'from' ) : ''; 		/** This filter is documented in wp-admin/includes/revision.php */		$content_to = apply_filters( "_wp_post_revision_field_{$field}", $compare_to->$field, $field, $compare_to, 'to' ); 		$args = array(			'show_split_view' => true,

Changelog

Introduced in 3.6.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 6.8.8 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.