General Question

wenn's avatar

Wordpress experts...exclude category by name instead of ID?

Asked by wenn (2673points) 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

jackm's avatar

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.

wenn's avatar

@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.

jackm's avatar

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?

wenn's avatar

@jackm not that I have discovered so far.

jackm's avatar

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

Login

or

Join

to answer.

This question is in the General Section. Responses must be helpful and on-topic.

Your answer will be saved while you login or join.

Have a question? Ask Fluther!

What do you know more about?
or
Knowledge Networking @ Fluther