Created
November 15, 2024 11:30
-
-
Save g-maclean/497f9e18f345414e0aaf7eabe4864e0a to your computer and use it in GitHub Desktop.
PropertyHive - match address 2 & 3 in similar properties shortcode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter('propertyhive_shortcode_similar_properties_query','match_addresses_2_and_3', 2, 10); | |
| function match_addresses_2_and_3($args, $atts){ | |
| $original_match_query = $args['meta_query'][3]; | |
| if($original_match_query['key']!='_address_three'){return $args;} | |
| $new_match_query[] = $original_match_query; | |
| $new_match_query[] = array("key" => "_address_two", "value" => $original_match_query["value"]); | |
| $args['meta_query'][3] = array('relation' => 'OR', $new_match_query); | |
| return $args; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment