Timeline for Check if searched number is within the post meta value
Current License: CC BY-SA 4.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 25, 2019 at 21:13 | answer | added | WebElaine | timeline score: 1 | |
Sep 25, 2019 at 20:38 | comment | added | sfarzoso | @WebElaine could you show me an example? | |
Sep 25, 2019 at 18:26 | comment | added | WebElaine | No, set up an array first that contains all the possible values, and use that in your args. | |
Sep 25, 2019 at 16:51 | comment | added | sfarzoso | @WebElaine so do you suggest a foreach on the result and unset the unwanted values | |
Sep 25, 2019 at 16:43 | comment | added | WebElaine |
You may need to first run a query to find all possible values of property-guests . So for example, maybe you have properties with room for 4, 7, and 10 guests. If a visitor searches for 5, you first get all the property-guests numbers and isolate the ones that are greater than or equal to 5 (the search). Add those all to an array (at this point, an array including 7 and 10). Then, pass that array in terms in your query and you will find all the properties that have room for that many guests.
|
|
Sep 25, 2019 at 16:41 | comment | added | WebElaine |
'compare' => 'IN' actually means, "see if this exact value is contained in the field." So, 5 will never be "in" 10. I don't think a WP tax query actually supports checking whether a numeric value is "less than or equal to" a number, which is what you're looking for.
|
|
Sep 25, 2019 at 14:22 | history | asked | sfarzoso | CC BY-SA 4.0 |