_wp_post_revision_field_{$field} WordPress Filter Hook

This hook is called whenever a revision is saved for a post. It allows you to add your own custom fields to the revision post type.

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

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

Top ↑

Parameters

$revision_field

(string)The current revision field to compare to or from.

$field

(string)The current revision field.

$compare_from

(WP_Post)The revision post object to compare to or from.

$context

(string)The context of whether the current revision is the old or the new one. Values are 'to' or 'from'.


Top ↑

Source

File: wp-admin/includes/revision.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
3.6.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.