_wp_post_revision_fields

_wp_post_revision_fields

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter
See hook in action

See hook in core

Displaying hooks found in version: wordpress-6.7.2

apply_filters('_wp_post_revision_fields') is found 1 times:

  • /wp-includes/revision.php line 54
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    * @param string[] $fields List of fields to revision. Contains 'post_title',
     *                         'post_content', and 'post_excerpt' by default.
     * @param array    $post   A post array being processed for insertion as a post revision.
     */
    $fields = apply_filters( '_wp_post_revision_fields', $fields, $post );
     
    // WP uses these internally either in versioning or elsewhere - they cannot be versioned.
    foreach ( array( 'ID', 'post_name', 'post_parent', 'post_date', 'post_date_gmt', 'post_status', 'post_type', 'comment_count', 'post_author' ) as $protect ) {
        unset( $fields[ $protect ] );
    }

See this hook used in plugins: