get_term_meta_from_cache

Description

located in the file / of the plugin . Uses the functions , and .

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

Related

get_term_meta

By the Web Warlock, Wednesday, 4/Aug/2010 10:46

located in the file / of the plugin . Reads the fields and of the table. Uses the functions , , and , and the methods and and the property of the global object .

<?php get_term_meta( $term_id , $key , $single = false , $use_cache = true , $single_id = 0 );