Assuming your “property-guests” taxonomies have names like “1”, “2”, “3”, etc.:
<?php
// Get the number of guests the visitor searched for
$requiredGuests = $_POST['guests'];
// Get all terms in the "property-guests" taxonomy
// (By default, this will only include terms that are assigned to something)
$allGuestNumbers = get_terms(array('taxonomy' => 'property-guests'));
// Create a variable to use in the args later
$queryNumbers="";
// Determine which properties have enough room for the number of guests requested
foreach($allGuestNumbers as $guestNumber) {
// Check if the number is greater than or equal to the number requested
if($guestNumber->name >= $requiredGuests) {
// If so, add to the variable for args, with a comma to separate the numbers
$queryNumbers .= $guestNumber->name . ',';
}
}
// Now, use the variable in the args
$guests_tax_array = array(
'taxonomy' => 'property-guests',
'field' => 'term_id',
'terms' => $queryNumbers,
'compare' => 'IN'
);
?>
If your “property-guests” taxonomies don’t have digits as their names, you could use their slugs, or a substring of the name or slug – it just depends on how you set up the individual terms.