首页 WordPress函数大全 get_term_field()

get_term_field()

2020-05-01 / 2054阅 / 悠然

如何你看完本文还不知道如何使用该函数,可以联系我定制视频教程,50元/个函数,学不会全额退款

get_term_field( string $field, int|WP_Term $term, string $taxonomy = '', string $context = 'display' )

Get sanitized Term field.

描述

The function is for contextual reasons and for simplicity of usage.

See also See also

  • sanitize_term_field()

Top ↑

参数

$field

(string)
(Required)
Term field to fetch.

$term

(int|WP_Term)
(Required)
Term ID or object.

$taxonomy

(string)
(Optional)
Taxonomy Name.

Default value: ''

$context

(string)
(Optional)
default is display. Look at sanitize_term_field() for available options.

Default value: 'display'

返回

(string|int|null|WP_Error) Will return an empty string if $term is not an object or if $field is not set in $term.

大家谈论
    我的见解