get_post_data from 1.6
This commit is contained in:
parent
c957971b4e
commit
8d8b3e3d30
|
@ -83,6 +83,16 @@ abstract class WC_Product {
|
|||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the product's post data.
|
||||
*
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function get_post_data() {
|
||||
return $this->post;
|
||||
}
|
||||
|
||||
/**
|
||||
* get_gallery_attachment_ids function.
|
||||
*
|
||||
|
|
|
@ -86,7 +86,7 @@ class WC_Product_Variation extends WC_Product {
|
|||
|
||||
// Get post data
|
||||
$this->parent = ! empty( $args['parent'] ) ? $args['parent'] : get_product( $this->id );
|
||||
$this->post = $this->parent->post;
|
||||
$this->post = ! empty( $this->parent->post ) ? $this->parent->post : array();
|
||||
$this->product_custom_fields = get_post_meta( $this->variation_id );
|
||||
|
||||
// Get the variation attributes from meta
|
||||
|
|
Loading…
Reference in New Issue