Last active
September 18, 2021 12:03
-
-
Save denisbaranov/dd677d15064d26c0d299f49de58a4d42 to your computer and use it in GitHub Desktop.
You can find some code samples for using hooks in the extension User Locations
This file contains 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
<?php | |
/** | |
* Disable Clustering | |
* You may add this code to the file functions.php in the active theme directory. | |
* | |
* @author Ultimate Member support <support@ultimatemember.com> | |
* @link https://ultimatemember.com/extensions/user-locations/ | |
*/ | |
add_action( 'wp_footer', function () { | |
if ( function_exists( 'UM' ) ) { | |
?><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 ); |
This file contains 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
<?php | |
/** | |
* Change the map marker title | |
* You may add this code to the file functions.php in the active theme directory. | |
* | |
* @author Ultimate Member support <support@ultimatemember.com> | |
* @link https://ultimatemember.com/extensions/user-locations/ | |
*/ | |
add_action( 'wp_footer', function () { | |
if ( function_exists( 'UM' ) ) { | |
?><script type="text/javascript"> | |
wp.hooks.addFilter('um_user_locations_marker_data', 'um_user_locations', function (marker_data, hash, userdata) { | |
marker_data.title = userdata.display_name; | |
return marker_data; | |
}, 20); | |
</script><?php | |
} | |
}, 20 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment