WC_Abstract_Legacy_Product::get_post_data
Deprecated since 3.0.0. It is no longer supported and may be removed in future releases. It is recommended to replace this function with the same one.
Get the product's post data.
Method of the class: WC_Abstract_Legacy_Product{}
No Hooks.
Returns
WP_Post
.
Usage
$WC_Abstract_Legacy_Product = new WC_Abstract_Legacy_Product(); $WC_Abstract_Legacy_Product->get_post_data();
Changelog
Deprecated since | 3.0.0 |
WC_Abstract_Legacy_Product::get_post_data() WC Abstract Legacy Product::get post data code WC 9.9.3
public function get_post_data() { wc_deprecated_function( 'WC_Product::get_post_data', '3.0', 'get_post' ); // In order to keep backwards compatibility it's required to use the parent data for variations. if ( $this->is_type( ProductType::VARIATION ) ) { $post_data = get_post( $this->get_parent_id() ); } else { $post_data = get_post( $this->get_id() ); } return $post_data; }