[wp-hackers] get_objects_in_term

Anthony Cole me at anthony.geek.nz
Fri Dec 4 13:06:01 UTC 2009

Hey All,

I've been troubleshooting this all night and I still can't figure it out. It seems so simple - but for some reason, get_objects_in_term is acting up and returning an empty array. 

I have the following markup - have had two people look over it and they said it looks fine. 

> $vars = array('location', 'pricing', 'rating');
> foreach($vars as $var) {
> 	if(empty($_GET[$var]) || $_GET[$var] == 'all')
> 		$taxonomies[] = 'bell_' . $var;
> 	else
> 		$terms[] = $_GET[$var];
> 	}
> 	$nums = array_map('intval', $terms);  // tried doing this outside the function as well as the id was a string
> 	$objects = get_objects_in_term( $nums, $taxonomies );
> 	$ids = implode(',', $objects);

I've var_dumped $nums and $taxonomies and they're coming out the other end fine. Doing the get_objects_in_term query manually works.

Any ideas?


More information about the wp-hackers mailing list