How do Wordpress search custom fields?
I searched and saw that the search for it works by using the title and content of the content. I've created a project that uses custom fields, such as: address, and phone number, with the user being able to type the city name , address , status or phone .
The city name is the normal title, the rest of the fields are all custom.
I'm using a query to do this because I'm displaying the result via ajax
$string = $_GET['string'];
$argumentos = [
'post_type' => 'unidade',
'posts_per_page' => -1,
's' => $string
];
$posts = new WP_Query($argumentos);
?>