Merge pull request #9765 from maxrice/wc-product-get-id

Introduce WC_Product::get_id() method
This commit is contained in:
Claudio Sanches 2015-12-04 21:16:13 -02:00
commit 3a19cf6c28
2 changed files with 22 additions and 0 deletions

View File

@ -166,6 +166,17 @@ class WC_Product {
return apply_filters( 'woocommerce_product_supports', in_array( $feature, $this->supports ) ? true : false, $feature, $this );
}
/**
* Return the product ID
*
* @since 2.5.0
* @return int product (post) ID
*/
public function get_id() {
return $this->id;
}
/**
* get_gallery_attachment_ids function.
*

View File

@ -147,6 +147,17 @@ class WC_Product_Variation extends WC_Product {
return $value;
}
/**
* Return the variation ID
*
* @since 2.5.0
* @return int variation (post) ID
*/
public function get_id() {
return $this->variation_id;
}
/**
* Returns whether or not the product post exists.
*