<?php get_term_meta( $term_id , $key , $single = false , $use_cache = true , $single_id = 0 );
get_term_meta_from_cache
Description
Retrieves the specified term metadata from cache. Initializes the cache for that term metadata if it is not set yet.
Synopsis
<?php get_term_meta_from_cache( $term_id , $key ); ?>
Source
<?php function get_term_meta_from_cache( $term_id , $key ){ if( !( $term_meta = wp_cache_get( $term_id , 'termmeta' ) ) ){ $term_meta = (array)get_term_custom( $term_id , NULL , array( 'force_query' => true , 'unfiltered' => true ) ) ; wp_cache_set( $term_id , $term_meta , 'termmeta' ); }; $results=array() ; foreach( $term_meta as $term_data ){ if( $term_data->meta_key == $key ) $results[] = $term_data->meta_value ; } ; return $results ; } ; ?>