WC_Product_Data_Store_CPT::read_extra_data( WC_Product $product )

Read extra data associated with the product, like button text or product URL for external products.


Description Description


Parameters Parameters

$product

(Required) Product object.


Top ↑

Source Source

File: includes/data-stores/class-wc-product-data-store-cpt.php

	protected function read_extra_data( &$product ) {
		foreach ( $product->get_extra_data_keys() as $key ) {
			$function = 'set_' . $key;
			if ( is_callable( array( $product, $function ) ) ) {
				$product->{$function}( get_post_meta( $product->get_id(), '_' . $key, true ) );
			}
		}
	}

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.