Wordpress experts...exclude category by name instead of ID?
Asked by
wenn (
2673
)
December 2nd, 2009
I’m working on a plugin and it excludes a specific category, and I’m wondering if there is a simple solution to exclude by category_name instead of the category ID number.
I’ve been searching for a while and nothing has solved the issue yet.
Anyone point me to article or something?
Observing members:
0
Composing members:
0
6 Answers
Whats the difference? Can’t you simply look up the cat_name by ID number in the DB?
sorry if thats totally wrong, its been a years since I looked at wp.
@jackm because its for a plugin and I dont want users to have change category ID’s in the plugin file.
Category ID’s will change from user to user but the category name can remain constant. so im trying to eliminate the need to alter the category ID in the plugin.
What I am saying though is can’t you convert the users input of cat_name into cat ID with a few lines of code?
@jackm not that I have discovered so far.
Correct me if I am wrong, but cant you simply search the DB for the name they input and then select the ID associated with it?
Answer this question 
This question is in the General Section. Responses must be helpful and on-topic.