Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

[edit] This is a comment on the excellent answer by Stephen Harris.

It doesn't return any terms if used with multiple post types like this $flags = wpse57444_get_terms('flags', array('post_types' => array('country','city')));. This is because $wpdb->prepare sanitizes the $post_types_str string to p.post_type IN('country,city') while it should be p.post_type IN('country','city'). See this ticket: 11102. Use the solution from this topic to get around this: http://stackoverflow.com/a/10634225https://stackoverflow.com/a/10634225

[edit] This is a comment on the excellent answer by Stephen Harris.

It doesn't return any terms if used with multiple post types like this $flags = wpse57444_get_terms('flags', array('post_types' => array('country','city')));. This is because $wpdb->prepare sanitizes the $post_types_str string to p.post_type IN('country,city') while it should be p.post_type IN('country','city'). See this ticket: 11102. Use the solution from this topic to get around this: http://stackoverflow.com/a/10634225

[edit] This is a comment on the excellent answer by Stephen Harris.

It doesn't return any terms if used with multiple post types like this $flags = wpse57444_get_terms('flags', array('post_types' => array('country','city')));. This is because $wpdb->prepare sanitizes the $post_types_str string to p.post_type IN('country,city') while it should be p.post_type IN('country','city'). See this ticket: 11102. Use the solution from this topic to get around this: https://stackoverflow.com/a/10634225

added 1 characters in body
Source Link

[edit] This is a comment on the excellent answer by Stephen Harris.

It doesn't return any terms if used with multiple post types like this $flags = wpse57444_get_terms('flags', array('post_types' => array('country','city')));. This is because $wpdb->prepare sanitizes the $post_types_str string to p.post_type IN('country,city') while it should be p.post_type IN('country','city'). See this ticket: 11102. Use thisthe solution infrom this topic to get around this: http://stackoverflow.com/a/10634225

[edit] This is a comment on the excellent answer by Stephen Harris.

It doesn't return any terms if used with multiple post types like this $flags = wpse57444_get_terms('flags', array('post_types' => array('country','city')));. This is because $wpdb->prepare sanitizes the $post_types_str string to p.post_type IN('country,city') while it should be p.post_type IN('country','city'). See this ticket: 11102. Use this solution in this topic to get around this: http://stackoverflow.com/a/10634225

[edit] This is a comment on the excellent answer by Stephen Harris.

It doesn't return any terms if used with multiple post types like this $flags = wpse57444_get_terms('flags', array('post_types' => array('country','city')));. This is because $wpdb->prepare sanitizes the $post_types_str string to p.post_type IN('country,city') while it should be p.post_type IN('country','city'). See this ticket: 11102. Use the solution from this topic to get around this: http://stackoverflow.com/a/10634225

added 72 characters in body
Source Link

[edit] This is a comment on the excellent answer by Stephen Harris.

It doesn't return any terms if used with multiple post types like this $flags = wpse57444_get_terms('flags', array('post_types' => array('country','city')));. This is because $wpdb->prepare sanitizes the $post_types_str string to p.post_type IN('country,city') while it should be p.post_type IN('country','city'). See this ticket: 11102. Just don't use $wpdb->prepare or use the Use this solution in this topic to get around this: http://stackoverflow.com/a/10634225

It doesn't return any terms if used with multiple post types like this $flags = wpse57444_get_terms('flags', array('post_types' => array('country','city')));. This is because $wpdb->prepare sanitizes the $post_types_str string to p.post_type IN('country,city') while it should be p.post_type IN('country','city'). See this ticket: 11102. Just don't use $wpdb->prepare or use the solution in this topic to get around this: http://stackoverflow.com/a/10634225

[edit] This is a comment on the excellent answer by Stephen Harris.

It doesn't return any terms if used with multiple post types like this $flags = wpse57444_get_terms('flags', array('post_types' => array('country','city')));. This is because $wpdb->prepare sanitizes the $post_types_str string to p.post_type IN('country,city') while it should be p.post_type IN('country','city'). See this ticket: 11102. Use this solution in this topic to get around this: http://stackoverflow.com/a/10634225

Post Undeleted by keesiemeijer
Post Deleted by keesiemeijer
Source Link
Loading