WordPress at Your Fingertips
function is not described

WC_API_Products::set_product_category_image_as_attachment() protected WC 2.5.0

Sets uploaded category image as attachment and returns the attachment ID.

{} It's a method of the class: WC_API_Products{}

No Hooks.


Int. Attachment ID


// protected - for code of main (parent) or child class
$result = $this->set_product_category_image_as_attachment( $upload );
$upload(int) (required)
Upload information from wp_upload_bits


Since 2.5.0 Introduced.

Code of WC_API_Products::set_product_category_image_as_attachment() WC 5.7.1

protected function set_product_category_image_as_attachment( $upload ) {
	return $this->set_uploaded_image_as_attachment( $upload );