WC_Abstract_Legacy_Product::get_post_data()publicWC 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.

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 since 3.0.0

WC_Abstract_Legacy_Product::get_post_data() code WC 8.7.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;
}