Warning: This method has been deprecated.

WC_Abstract_Legacy_Product::get_post_data()

Get the product’s post data.


Description Description


Return Return

(WP_Post)


Top ↑

Source Source

File: includes/legacy/abstract-wc-legacy-product.php

	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;
	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.