I want to get a set of posts from a CPT based on a taxonomy term being present. I thought I'd use WP's get_posts() function:
$results = get_posts(array $options);
This function works fine when I specify the CPT i'm interested in:
$results = get_posts( array('post_type' => 'my_cpt_name') );
But then I tried this with my UOM custom post type and tried to filter on the metric system which is a taxonomy called "uom_system":
$results = get_posts( array('post_type' => 'uoms', 'uom_system' => 'metric-system' );
Sadly, the taxonomy section gets ignored and I get the full list of posts in the UOM posts table. What am I doing wrong?