}
}
+ $counties = array();
+ if ($actionData['request']['county-search']) {
+
+ // Convert comma separated list to an array
+ $regionsRequested = explode( ',', $actionData['request']['county-search'] );
+
+ // Check for numeric ID's only
+ while ( list( $k, $v ) = each( $regionsRequested ) ) {
+ if ( preg_match( '/^[0-9]*$/', trim( $v ) && $v > 0 ) ) {
+ $counties[] = ( $v - 0 );
+ }
+ }
+
+ if ( isset( $counties ) && !empty( $counties ) ) {
+ $where .= $whereSep." T.county IN (" . implode( ',', $counties ) . ")";
+ $whereSep = ' AND ';
+ }
+ }
+
// If there's regions shortcode or url options to restrict this page to certain regions
if (count($regions) > 0) {