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 |
---|---|
202 |
|
203 | /** |
204 | * Filters the revisions to be considered for deletion. |
205 | * |
206 | * @since 6.2.0 |
207 | * |
208 | * @param WP_Post[] $revisions Array of revisions, or an empty array if none. |
209 | * @param int $post_id The ID of the post to save as a revision. |
210 | */ |
211 | $revisions = apply_filters( |
212 | 'wp_save_post_revision_revisions_before_deletion', |
213 | $revisions, |
214 | $post_id |
215 | ); |
216 |
|
217 | $delete = count( $revisions ) - $revisions_to_keep; |
218 |
|
219 | if ( $delete < 1 ) { |
220 | return $return; |