WordPress at a glance

get_term_meta() WP 1.0

Retrieves metadata for a term.

Works based on: get_metadata()
✈ 1 time = 0.000125s = fast | 50000 times = 0.20s = very fast | PHP 7.1.2, WP 4.7.3

No Hooks.


Mixed. If $single is false, an array of metadata values. If $single is true, a single metadata value.


get_term_meta( $term_id, $key, $single );
$term_id(int) (required)
Term ID.
The meta key to retrieve. If no key is provided, fetches all metadata for the term.
Default: ''
Whether to return a single value. If false, an array of all values matching the $term_id/$key pair will be returned.
Default: false


Since 4.4.0 Introduced.

Code of get term meta: wp-includes/taxonomy.php WP 5.4.2

function get_term_meta( $term_id, $key = '', $single = false ) {
	return get_metadata( 'term', $term_id, $key, $single );

Related Functions

From tag: Metadatas (any)

No comments
        Log In . Register