Unsupported_Products::prevent_publication( array $data, array $postarr )
Summary
No summary available.Parameters
- $data
-
(array) (Required) An array of sanitized attachment post data.
- $postarr
-
(array) (Required) An array of unsanitized attachment post data.
Return
(array)
Source
File: src/BigCommerce/Post_Types/Product/Unsupported_Products.php
public function prevent_publication( $data, $postarr ) { if ( ! empty( $postarr[ 'ID' ] ) && in_array( $data[ 'post_status' ], [ 'publish', 'future', ] ) && $this->is_unsupported_product( $postarr[ 'ID' ] ) ) { $data[ 'post_status' ] = 'draft'; } return $data; }