Deletion::delete_product_data( int $post_id )
Summary
No summary available.Parameters
- $post_id
-
(int) (Required)
Return
(void)
Source
File: src/BigCommerce/Post_Types/Product/Deletion.php
public function delete_product_data( $post_id ) { if ( get_post_type( $post_id ) !== Product::NAME ) { return; } $product = new Product( $post_id ); $bc_id = $product->bc_id(); if ( $bc_id ) { $another_channel_post = $this->get_post_in_another_channel( $bc_id, $post_id ); if ( $another_channel_post ) { // re-assign the child images to another post $this->reparent_images( $post_id, $another_channel_post ); } else { // the product is complete gone from the site, so get rid of all related imported content $this->remove_images( $post_id ); } } }