WC_API_Products::set_product_image_as_attachment()
Sets product image as attachment and returns the attachment ID.
Method of the class: WC_API_Products{}
No Hooks.
Return
Int
.
Usage
// protected - for code of main (parent) or child class $result = $this->set_product_image_as_attachment( $upload, $id );
- $upload(array) (required)
- -
- $id(int) (required)
- -
Changelog
Since 2.2 | Introduced. |
WC_API_Products::set_product_image_as_attachment() WC API Products::set product image as attachment code WC 8.7.0
protected function set_product_image_as_attachment( $upload, $id ) { return $this->set_uploaded_image_as_attachment( $upload, $id ); }