WC_Abstract_Legacy_Product::get_post_data() public WC 1.0
Deprecated from version 3.0.0. It is no longer supported and can be removed in future releases. It is recommended to replace this function with the same one.╳
Get the product's post data.
{} It's a method of the class: WC_Abstract_Legacy_Product{}
No Hooks.
Return
WP_Post.
Usage
$WC_Abstract_Legacy_Product = new WC_Abstract_Legacy_Product(); $WC_Abstract_Legacy_Product->get_post_data();
Changelog
Deprecated | 3.0.0 |
Code of WC_Abstract_Legacy_Product::get_post_data() WC Abstract Legacy Product::get post data WC 5.0.0
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( 'variation' ) ) {
$post_data = get_post( $this->get_parent_id() );
} else {
$post_data = get_post( $this->get_id() );
}
return $post_data;
}