Automattic\WooCommerce\Internal\DataStores\Orders

DataSynchronizer::handle_deleted_post()privateWC 1.0

Handle the deleted_post

When posts is authoritative and sync is enabled, deleting a post also deletes COT data.

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

No Hooks.

Return

null. Nothing.

Usage

// private - for code of main (parent) class only
$result = $this->handle_deleted_post( $postid, $post ): void;
$postid(int) (required)
The post id.
$post(WP_Post) (required)
The deleted post.

Code of DataSynchronizer::handle_deleted_post() WC 7.1.0

private function handle_deleted_post( $postid, $post ): void {
	if ( 'shop_order' === $post->post_type && ! $this->custom_orders_table_is_authoritative() && $this->data_sync_is_enabled() ) {
		$this->data_store->delete_order_data_from_custom_order_tables( $postid );
	}
}