删除修订。

原型

wp_delete_post_revision( int|WP_Post $revision_id )

描述

从posts表中删除与指定修订对应的行。

参数

$revision_id (int|WP_Post) (Required) 修订版ID或修订对象。

返回值

(array|false|WP_Post|WP_Error|null)  空或

源文件

路径:wp-includes/revision.php

<?php
...
function wp_delete_post_revision( $revision_id ) {
	if ( ! $revision = wp_get_post_revision( $revision_id ) ) {
		return $revision;
	}
	$delete = wp_delete_post( $revision->ID );
	if ( $delete ) {
		/**
		 * Fires once a post revision has been deleted.
		 *
		 * @since 2.6.0
		 *
		 * @param int          $revision_id Post revision ID.
		 * @param object|array $revision    Post revision object or array.
		 */
		do_action( 'wp_delete_post_revision', $revision->ID, $revision );
	}
	return $delete;
}
...
?>

其他

英文文档:https://developer.wordpress.org/reference/functions/wp_delete_post_revision/