Kyle, we made the usual changes but assume we are going wrong somwhere as it isnt working. We changed the following files and added into the sections stated – are we missing anything obvious?
Field is called property_bedrooms in the database and the file being pulled in is pyb but it doesn’t seem to pull the value through.
If we set the code below to the following manually it works property_bedrooms >= ‘3’
I have a feeling some of the edits below may not be required but trying everything to get it to work.
Any help would be appreciated.
LocationSearch.php
- Sanitize and set the user-submitted data
'pyb' => sanitize_text_field($_POST['pyb']),
- added this to SET QUERY DATA
$this->query_data['pyb'] = $this->data['pyb'];
- Added this to set the query
AND property_bedrooms >= 'pyb'
simple-locator-form.php / FORM
<select name="pyb">
<option value="1">1</option>
<option value="6">6</option>
<option value="9">9</option>
</select>