wp_delete_post_revision

Advertisement

Summery Summery

Deletes a revision.

Syntax Syntax

wp_delete_post_revision( int|WP_Post $revision_id )

Description Description

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

Parameters Parameters

$revision_id

(int|WP_Post) (Required) Revision ID or revision object.

Return Return

(array|false|WP_Post|WP_Error|null) Null or WP_Error if error, deleted post if success.

Source Source

File: wp-includes/revision.php

	do_action( 'wp_restore_post_revision', $post_id, $revision['ID'] );

	return $post_id;
}

/**
 * Deletes a revision.
 *
 * Deletes the row from the posts table corresponding to the specified revision.
 *
 * @since 2.6.0
 *
 * @param int|WP_Post $revision_id Revision ID or revision object.
 * @return array|false|WP_Post|WP_Error|null Null or WP_Error if error, deleted post if success.
 */
function wp_delete_post_revision( $revision_id ) {
	$revision = wp_get_post_revision( $revision_id );
	if ( ! $revision ) {
		return $revision;
	}

Advertisement

Changelog Changelog

Changelog
Version Description
2.6.0 Introduced.

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.