[wp-hackers] Obtaining category id from new permalinks system
aaron at technosailor.com
Tue Jan 3 16:45:53 GMT 2006
On 1/3/06, Rob Schumann <robs_wph at rs-tc.com> wrote:
> I need to be able to obtain the id of the requested category
> when permalinks are enabled.
> The method used under WP1.5.* no longer works and I cannot
> find any hint as to where to look for the information under
> So, any pointers as to where this, and other information
> transmitted via permalinks would be very gratefully
Untested, but you could add something like this to a plugin..
return $wpdb->get_var("SELECT cat_ID FROM ".$wpdb->categories." WHERE
category_nicename = ''.sanitize_title($catname).");
If you want more than just the ID, you can do that by changing the query.
That what you're looking for?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the wp-hackers