get_term_field


get_term_field ( $field, $term, $taxonomy = '', $context = 'display' )

Parameters:
  • (string) field Term field to fetch.
  • (int|WP_Term) term Term ID or object.
  • (string) taxonomy Optional. Taxonomy name. Default empty.
  • (string) context Optional. How to sanitize term fields. Look at sanitize_term_field() for available options. Default 'display'.
See:
Returns:
  • (string|int|null|WP_Error) Will return an empty string if $term is not an object or if $field is not set in $term.
Defined at:
Change Log:
  • 4: .

Description

Gets sanitized term field.The function is for contextual reasons and for simplicity of usage.

Related Functions

get_post_field, get_term_children, _get_term_children, get_the_id, get_term_feed_link

Top Google Results

User discussions

wpseek mobile