wpseek.com
WordPress开发者和主题制作者的搜索引擎
get_term_field › WordPress Function
Since2.3.0
已弃用n/a
› get_term_field ( $field, $term, $taxonomy = '', $context = 'display' )
参数: (4) |
|
查看: | |
返回: |
|
定义在: |
|
文档: | |
Change Log: |
|
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
源码
function get_term_field( $field, $term, $taxonomy = '', $context = 'display' ) { $term = get_term( $term, $taxonomy ); if ( is_wp_error( $term ) ) { return $term; } if ( ! is_object( $term ) ) { return ''; } if ( ! isset( $term->$field ) ) { return ''; } return sanitize_term_field( $field, $term->$field, $term->term_id, $term->taxonomy, $context ); }