Created
May 29, 2025 16:16
-
-
Save propertyhive/4279e6da20ea4e38ae57318968ea3cd4 to your computer and use it in GitHub Desktop.
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_agentsinsight_xml_properties_due_import', 'filter_kato_properties_by_tag', 10, 1 ); | |
function filter_kato_properties_by_tag( $properties ) | |
{ | |
$allowed_tags = array( 'British Museum' ); // Define your allowed tags here | |
$filtered_properties = array(); | |
foreach ( $properties as $property ) | |
{ | |
if ( isset($property->tags) ) | |
{ | |
foreach ( $property->tags as $tags ) | |
{ | |
foreach ( $tags->tag as $tag ) | |
{ | |
$tag = (string)$tag; | |
if ( in_array( $tag, $allowed_tags ) ) { | |
$filtered_properties[] = $property; | |
break; | |
} | |
} | |
} | |
} | |
} | |
return $filtered_properties; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment