get_post_data from 1.6

This commit is contained in:
Mike Jolley 2013-01-11 18:30:05 +00:00
parent c957971b4e
commit 8d8b3e3d30
2 changed files with 11 additions and 1 deletions

View File

@ -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.
*

View File

@ -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