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
3252      if ( !$fields ) {
3253           // Allow these to be versioned
3254           $fields = array(
3255                'post_title' => __( 'Title' ),
3256                'post_content' => __( 'Content' ),
3257                'post_excerpt' => __( 'Excerpt' ),
3258           );
3259
3260           // Runs only once
3261           $fields = apply_filters( '_wp_post_revision_fields', $fields );
3262
3263           // WP uses these internally either in versioning or elsewhere - they cannot be versioned
3264           foreach ( array( 'ID', 'post_name', 'post_parent', 'post_date', 'post_date_gmt', 'post_status', 'post_type', 'comment_count', 'post_author' ) as $protect )
3265                unset( $fields[$protect] );
3266      }
3267
3268      if ( !is_array($post) )
3269           return $fields;
3270