Introduce WC_Product::get_id() method
This commit is contained in:
parent
0f5c70e33f
commit
3befe1426f
|
@ -166,6 +166,17 @@ class WC_Product {
|
||||||
return apply_filters( 'woocommerce_product_supports', in_array( $feature, $this->supports ) ? true : false, $feature, $this );
|
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.
|
* get_gallery_attachment_ids function.
|
||||||
*
|
*
|
||||||
|
|
|
@ -147,6 +147,17 @@ class WC_Product_Variation extends WC_Product {
|
||||||
return $value;
|
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.
|
* Returns whether or not the product post exists.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue