Answer the question
In order to leave comments, you need to log in
How do I get an exact match when entering an ID?
Hello everyone, the essence of the matter is as follows - the site has a form for searching real estate by ID, so when we enter, let's say 0049, we get all the real estate containing this ID (example 00049.00498), but we need to display an exact match.
Here is the code responsible for the ID parameter
/* Property ID Parameter */
if( isset($_GET['property-id']) && !empty($_GET['property-id'])){
$property_id = trim($_GET['property-id']);
$meta_query[] = array(
'key' => 'REAL_HOMES_property_id',
'value' => $property_id,
'compare' => 'LIKE',
'type'=> 'CHAR'
);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question