[wp-hackers] Custom taxonomies for authors

Thomas Scholz info at toscho.de
Sat Mar 13 01:06:02 UTC 2010


Hello,

I just create a website for cat breeders. Every breeder I created as an  
author, and for most of the meta data I used custom contact fields:

function toscho_contact_fields($originals)
{
	return array(
		'street'	=> 'Straße',
		'plz'		=> 'Postleitzahl',
		'ort'		=> 'Ort',
		'land'		=> 'Land',
		'zwinger'	=> 'Zwinger',
		'phone'		=> 'Telefon',
		'mnumber'	=> 'Mitgliedsnummer'
	);
}
add_filter('user_contactmethods', 'toscho_contact_fields');

Now, however, I am confronted with a problem that I can not solve with  
contact fields: Each member breeds cats in very specific colors. The  
visitor should be able to get a list of all breeders with a color of his  
choice.

'usermeta' isn’t made for n:n-relationships. I’d rather use something like  
this:

register_taxonomy(
	'color',
	'user',
	array(
		'hierarchical'	=> false,
		'label'			=> 'Color',
		'query_var'		=> 'color',
		'rewrite'		=> array('slug' => 'color')
	)
);

But it doesn’t show any visible result (and I didn’t really expect it to  
do).

What would be the best way to implement this functionality?

Regards
Thomas

-- 
http://toscho.de


More information about the wp-hackers mailing list