Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_save_post_revision_revisions_before_deletion

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
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;