WordPress at Your Fingertips
function is not described

WC_Product_Data_Store_CPT::read_extra_data() protected WC 3.0.0

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

{} It's a method of the class: WC_Product_Data_Store_CPT{}

No Hooks.

Return

null. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->read_extra_data( $product );
$product(WC_Product) (required) (passed by reference — &)
Product object.

Changelog

Since 3.0.0 Introduced.

Code of WC_Product_Data_Store_CPT::read_extra_data() WC 5.8.0

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