WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
| Line | Code |
|---|---|
| 4345 | if ( !$fields ) { |
| 4346 | // Allow these to be versioned |
| 4347 | $fields = array( |
| 4348 | 'post_title' => __( 'Title' ), |
| 4349 | 'post_content' => __( 'Content' ), |
| 4350 | 'post_excerpt' => __( 'Excerpt' ), |
| 4351 | ); |
| 4352 | |
| 4353 | // Runs only once |
| 4354 | $fields = apply_filters( '_wp_post_revision_fields', $fields ); |
| 4355 | |
| 4356 | // WP uses these internally either in versioning or elsewhere - they cannot be versioned |
| 4357 | foreach ( array( 'ID', 'post_name', 'post_parent', 'post_date', 'post_date_gmt', 'post_status', 'post_type', 'comment_count', 'post_author' ) as $protect ) |
| 4358 | unset( $fields[$protect] ); |
| 4359 | } |
| 4360 | |
| 4361 | if ( !is_array($post) ) |
| 4362 | return $fields; |
| 4363 | |