categories - Check if value is a custom taxonomy category name

admin2025-01-07  3

I'm needing to check a variable and if the slug doesn't match a custom taxonomy's category slug run a function. I can't wrap my head around what I would need to do in order to get the "categories" of a custom taxonomy in an array and check them against a value.

All help is greatly appreciated.

I'm needing to check a variable and if the slug doesn't match a custom taxonomy's category slug run a function. I can't wrap my head around what I would need to do in order to get the "categories" of a custom taxonomy in an array and check them against a value.

All help is greatly appreciated.

Share Improve this question asked Jul 23, 2013 at 20:39 Austin BiggsAustin Biggs 3843 silver badges19 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

You must use get_terms in order to obtain all the "categories" of a custom taxonomy.

http://codex.wordpress.org/Function_Reference/get_terms

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1736262001a784.html

最新回复(0)