WordPress at a glance

get_term_meta() WP 1.0

Retrieves metadata for a term.

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

No Hooks.

Return

Mixed. An array if $single is false. The value of the meta field if $single is true. False for an invalid $term_id.

Usage

get_term_meta( $term_id, $key, $single );
$term_id(int) (required)
Term ID.
$key(string)
The meta key to retrieve. By default, returns data for all keys.
Default: ''
$single(true|false)
Whether to return a single value. This parameter has no effect if $key is not specified.
Default: false

Changelog

Since 4.4.0 Introduced.

Code of get_term_meta() WP 5.7.2

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

From tag: Metadatas (any)

No comments
    Log In