最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

categories - Restrict retrieved terms by category?

programmeradmin1浏览0评论

Is there a way to add a layer to the terms to be able to only retrieve the terms based on a category?

I have terms attached to multiple different categories, but a lot less in individual categories.

$terms = get_terms( 'vehicles', array(
    'orderby'       => 'name',
    'child_of'      => $term_id,
    'hide_empty'    => $hide_empty
));

Is there a way to also add in the category? Example "Accessories" to filter yet again?

EDIT:

Illustrating my needs a bit more:

So i need to get the Vehicle taxonomies, there's a vehicles attached to ALL the categories shown, however I want to get all the taxonomies (vehicles) only inside the accessories, and if i choose a vehicle Make, i need to receive the children of that vehicle make taxonomy but still filtered by the category id (Accessories, 14901)

Does this make more sense?

发布评论

评论列表(0)

  1. 暂无评论