wordpress get data from post type and taxonomy id
$posts_array = get_posts(
array(
'posts_per_page' => -1,
'post_type' => 'fabric_building',
'tax_query' => array(
array(
'taxonomy' => 'fabric_building_types',
'field' => 'term_id',
'terms' => $cat->term_id,
)
)
)
);
foreach ($posts_array as $post) {
print_r($post);
echo $post->ID;
}