Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save propertyhive/d9407e159dfc5f8b3cd9fdfc4d920e50 to your computer and use it in GitHub Desktop.
Save propertyhive/d9407e159dfc5f8b3cd9fdfc4d920e50 to your computer and use it in GitHub Desktop.
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 ($property['tags'] == null || !is_array($property['tags'])) {
continue;
}
foreach ( $tags as $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