Filter hook 'wp_post_revision_meta_keys'

in WP Core File wp-includes/revision.php at line 584

View Source

wp_post_revision_meta_keys

Filter Hook
Description
Filter the list of post meta keys to be revisioned.

Hook Information

File Location wp-includes/revision.php View on GitHub
Hook Type Filter
Line Number 584

Hook Parameters

Type Name Description
array $keys An array of meta fields to be revisioned.
string $post_type The post type being revisioned.

Usage Examples

Basic Usage
<?php
// Hook into wp_post_revision_meta_keys
add_filter('wp_post_revision_meta_keys', 'my_custom_filter', 10, 2);

function my_custom_filter($keys, $post_type) {
    // Your custom filtering logic here
    return $keys;
}

Source Code Context

wp-includes/revision.php:584 - How this hook is used in WordPress core
<?php
 579  	 * @since 6.4.0
 580  	 *
 581  	 * @param array  $keys      An array of meta fields to be revisioned.
 582  	 * @param string $post_type The post type being revisioned.
 583  	 */
 584  	return apply_filters( 'wp_post_revision_meta_keys', $wp_revisioned_meta_keys, $post_type );
 585  }
 586  
 587  /**
 588   * Check whether revisioned post meta fields have changed.
 589   *

PHP Documentation

<?php
/**
	 * Filter the list of post meta keys to be revisioned.
	 *
	 * @since 6.4.0
	 *
	 * @param array  $keys      An array of meta fields to be revisioned.
	 * @param string $post_type The post type being revisioned.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/revision.php
Related Hooks

Related hooks will be displayed here in future updates.