Merge pull request #9765 from maxrice/wc-product-get-id
Introduce WC_Product::get_id() method
This commit is contained in:
commit
3a19cf6c28
|
@ -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.
|
||||
*
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue