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 |
|---|---|
| 177 | * This filter can override that so a revision is saved even if nothing has changed. |
| 178 | * |
| 179 | * @since 3.6.0 |
| 180 | * |
| 181 | * @param bool $check_for_changes Whether to check for changes before saving a new revision. |
| 182 | * Default true. |
| 183 | * @param WP_Post $latest_revision The latest revision post object. |
| 184 | * @param WP_Post $post The post object. |
| 185 | */ |
| 186 | if ( isset( $latest_revision ) && apply_filters( 'wp_save_post_revision_check_for_changes', true, $latest_revision, $post ) ) { |
| 187 | $post_has_changed = false; |
| 188 | |
| 189 | foreach ( array_keys( _wp_post_revision_fields( $post ) ) as $field ) { |
| 190 | if ( normalize_whitespace( $post->$field ) !== normalize_whitespace( $latest_revision->$field ) ) { |
| 191 | $post_has_changed = true; |
| 192 | break; |
| 193 | } |
| 194 | } |
| 195 | |