/ Database / query.get_term_meta

Title : query.get_term_meta
Purpose : Retrieves metadata for a term
Syntax :
Input Parameters :
  • term_id: (int) (Required) Term ID.
  • key: The meta key to retrieve. If no key is provided, fetches all metadata for the term.
  • single: (bool) (Optional) Whether to return a single value. If false, an array of all values matching the $term_id/$key pair will be returned. Default: false.
Return Value : It returns: (mixed) If single is false, an array of metadata values. If single is true, a single metadata value
Example 1 :
Code :
Output :
Description : The above example code will output terms matching the term_id. As single param is not passed it has return array of single metadata value.


Most Popular

Leave a Reply

Your email address will not be published.