function wp_delete_post_revision( $revision_id ) {}

Deletes a revision.
Deletes the row from the posts table corresponding to the specified revision.


  • int|object $revision_id: Revision ID or revision object.

Return values

returns:Null or WP_Error if error, deleted post if success.

Defined actions

  • wp_delete_post_revision
    do_action( 'wp_delete_post_revision', $revision->ID, $revision );

Source code

function wp_delete_post_revision( $revision_id ) {

	if ( !$revision = wp_get_post_revision( $revision_id ) )

		return $revision;

	$delete = wp_delete_post( $revision->ID );

	if ( is_wp_error( $delete ) )

		return $delete;

	if ( $delete )

		do_action( 'wp_delete_post_revision', $revision->ID, $revision );

	return $delete;



No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: