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.
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 ) ); } } }
Changelog Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |