WordPress at Your Fingertips
function is not described

WC_Data::prime_raw_meta_data_cache() public WC 4.7.0

Prime caches for raw meta data. This includes meta_id column as well, which is not included by default in WP meta data.

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

No Hooks.


null. Nothing.


$result = WC_Data::prime_raw_meta_data_cache( $raw_meta_data_collection, $cache_group );
$raw_meta_data_collection(array) (required)
Array of objects of { object_id => array( meta_row_1, meta_row_2, ... }.
$cache_group(string) (required)
Name of cache group.


Since 4.7.0 Introduced.

Code of WC_Data::prime_raw_meta_data_cache() WC 5.8.0

public static function prime_raw_meta_data_cache( $raw_meta_data_collection, $cache_group ) {
	foreach ( $raw_meta_data_collection as $object_id => $raw_meta_data_array ) {
		$cache_key = self::generate_meta_cache_key( $object_id, $cache_group );
		wp_cache_set( $cache_key, $raw_meta_data_array, $cache_group );