Skip to content

Instantly share code, notes, and snippets.

@yuriinalivaiko
Last active October 26, 2023 11:30
Show Gist options
  • Save yuriinalivaiko/e65f39aea73c1dd5a4bb4947ecf5f763 to your computer and use it in GitHub Desktop.
Save yuriinalivaiko/e65f39aea73c1dd5a4bb4947ecf5f763 to your computer and use it in GitHub Desktop.
This code snippet disables the map marker clustering in the User Locations extension.
<?php
/**
* Disable Clustering
*/
add_action( 'wp_footer', function () {
?><script type="text/javascript">
wp.hooks.addFilter( 'um_member_directory_disable_clustering', 'um_user_locations', function ( disableClustering, directory ) {
disableClustering = true;
return disableClustering;
}, 20 );
</script><?php
}, 20 );
@yuriinalivaiko
Copy link
Author

This gist is a part of the article User Locations - Hooks

You can add this code to the functions.php file in the active theme directory. Skip the opening <?php tag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment