the_terms()
the_terms( int $id, string $taxonomy, string $before = …
the_terms( int $id, string $taxonomy, string $before = ”, string $sep = ‘, ‘, string $after = ” )
在列表中显示术语。
Display the terms in a list.
在列表中显示术语。
Display the terms in a list.
目录锚点:#参数#源码#笔记
参数(Parameters)
| 参数 | 类型 | 说明 |
|---|---|---|
| $id | (int) | 职位ID。 |
| $taxonomy | (string) | 分类名称。 |
| $before | (string) | 在列表之前。 |
| $sep | (string) | 用这个分开。 |
| $after | (string) | 在列表之后。 |
源码(Source)
/**
* Display the terms in a list.
*
* @since 2.5.0
*
* @param int $id Post ID.
* @param string $taxonomy Taxonomy name.
* @param string $before Optional. Before list.
* @param string $sep Optional. Separate items using this.
* @param string $after Optional. After list.
* @return false|void False on WordPress error.
*/
function the_terms( $id, $taxonomy, $before = '', $sep = ', ', $after = '' ) {
$term_list = get_the_term_list( $id, $taxonomy, $before, $sep, $after );
if ( is_wp_error( $term_list ) )
return false;
/**
* Filter the list of terms to display.
*
* @since 2.9.0
*
* @param array $term_list List of terms to display.
* @param string $taxonomy The taxonomy name.
* @param string $before String to use before the terms.
* @param string $sep String to use between the terms.
* @param string $after String to use after the terms.
*/
echo apply_filters( 'the_terms', $term_list, $taxonomy, $before, $sep, $after );
}| 更新版本 | 源码位置 | 使用 | 被使用 |
|---|---|---|---|
| 2.5.0 | wp-includes/category-template.php | 20 | 15 |
笔记(Notes)
获取当前职位的类别
类别:WordPress 函数手册、
本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。


还没有任何评论,赶紧来占个楼吧!