get_term_meta() – Retrieves metadata for a term.

You appear to be a bot. Output may be restricted


Retrieves metadata for a term.


$mixed = get_term_meta( $term_id, $key, $single );


( int ) required – Term ID.
( string ) optional – Optional. The meta key to retrieve. By default, returns data for all keys. Default empty.
( bool ) optional – Optional. Whether to return a single value. This parameter has no effect if $key is not specified. Default false.


mixed An array of values if $single is false. The value of the meta field if $single is true. False for an invalid $term_id (non-numeric, zero, or negative value). An empty string if a valid but non-existing term ID is passed.


File name: wordpress/wp-includes/taxonomy.php

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

 View on GitHub View on Trac