_wp_post_revision_field_(field) filter-hook . WP 3.6.0
Contextually filter a post revision field.
The dynamic portion of the hook name, $field, corresponds to each of the post fields of the revision object being iterated over in a foreach statement.
Usage
add_filter( '_wp_post_revision_field_(field)', 'filter_function_name_5333', 10, 4 ); function filter_function_name_5333( $revision_field, $field, $compare_from, $context ){ // filter... return $revision_field; }
- $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'.
Changelog
Since 3.6.0 | Introduced. |
Where the hook is called
wp-admin/includes/revision.php 82
$content_from = $compare_from ? apply_filters( "_wp_post_revision_field_{$field}", $compare_from->$field, $field, $compare_from, 'from' ) : '';
wp-admin/includes/revision.php 85
$content_to = apply_filters( "_wp_post_revision_field_{$field}", $compare_to->$field, $field, $compare_to, 'to' );