
WordPress钩子详解:如何使用动作、过滤器和自定义钩子
term_description ( $term = 0, $deprecated = null )
term_description: 这个函数显示一个术语的描述。
检索术语描述。
function term_description( $term = 0, $deprecated = null ) { if ( ! $term && ( is_tax() || is_tag() || is_category() ) ) { $term = get_queried_object(); if ( $term ) { $term = $term->term_id; } } $description = get_term_field( 'description', $term ); return is_wp_error( $description ) ? '' : $description; }