WordPress开发者和主题制作者的搜索引擎



get_term_meta ›

Since4.4.0
已弃用n/a
get_term_meta ( $term_id, $key = '', $single = false )
参数: (3)
  • (int) $term_id Term ID.
    Required: Yes
  • (string) $key Optional. The meta key to retrieve. If no key is provided, fetches all metadata for the term.
    Required: No
    默认: (empty)
  • (bool) $single Whether to return a single value. If false, an array of all values matching the `$term_id`/`$key` pair will be returned. Default: false.
    Required: No
    默认: false
返回:
  • (mixed) If `$single` is false, an array of metadata values. If `$single` is true, a single metadata value.
定义在:
文档:

Retrieves metadata for a term.



源码

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