WC_API_Products::set_product_image_as_attachment()protectedWC 2.2

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() code WC 8.7.0

protected function set_product_image_as_attachment( $upload, $id ) {
	return $this->set_uploaded_image_as_attachment( $upload, $id );
}