WC_Post_Data::delete_postpublic staticWC 1.0

Removes variations etc. belonging to a deleted post, and clears transients, if the user has permission.

Метод класса: WC_Post_Data{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$result = WC_Post_Data::delete_post( $id );
$id(разное) (обязательный)
ID of post being deleted.

Код WC_Post_Data::delete_post() WC 10.5.2

public static function delete_post( $id ) {
	$container = wc_get_container();
	if ( ! $container->get( LegacyProxy::class )->call_function( 'current_user_can', 'delete_posts' ) || ! $id ) {
		return;
	}

	self::delete_post_data( $id );
}