Skip to content

Instantly share code, notes, and snippets.

@propertyhive
Created November 13, 2024 10:33
Show Gist options
  • Save propertyhive/ce14cfe5d4c1c4e04ff5c33ecd22e1a3 to your computer and use it in GitHub Desktop.
Save propertyhive/ce14cfe5d4c1c4e04ff5c33ecd22e1a3 to your computer and use it in GitHub Desktop.
add_filter( 'propertyhive_property_query_meta_query', 'filter_search_by_address_three', 10, 2 );
function filter_search_by_address_three( $meta_query, $query )
{
if ( isset( $_REQUEST['address_three'] ) )
{
$meta_query[] = array(
'key' => '_address_three',
'value' => sanitize_text_field($_REQUEST['address_three']),
);
}
return $meta_query;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment