Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: _wp_post_revision_fields

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
39            * Disallowed fields: 'ID', 'post_name', 'post_parent', 'post_date',
40            * 'post_date_gmt', 'post_status', 'post_type', 'comment_count',
41            * and 'post_author'.
42            *
43            * @since 2.6.0
44            *
45            * @param array $fields List of fields to revision. Contains 'post_title',
46            *                      'post_content', and 'post_excerpt' by default.
47            */
48           $fields = apply_filters( '_wp_post_revision_fields', $fields );
49
50           // WP uses these internally either in versioning or elsewhere - they cannot be versioned
51           foreach ( array( 'ID', 'post_name', 'post_parent', 'post_date', 'post_date_gmt', 'post_status', 'post_type', 'comment_count', 'post_author' ) as $protect )
52                unset( $fields[$protect] );
53      }
54
55      if ( !is_array($post) )
56           return $fields;
57