使用如何get_the_terms
像这样过滤,,
add_filter(\'get_the_terms\', \'hide_categories_terms\', 10, 3);
function hide_categories_terms($terms, $post_id, $taxonomy){
// get term to exclude by name, by id or maybe by slug
$exclude = get_term_by(\'name\', \'feature\', \'category\', ARRAY_A);
if (!is_admin()) {
foreach($terms as $key => $term){
if($term->taxonomy == "category"){
if(in_array($key, $exclude)) unset($terms[$key]);
}
}
}
return $terms;
}
我觉得应该行得通,,