Skip to content

Instantly share code, notes, and snippets.

@nikitasinelnikov
Last active May 4, 2021 12:51
Show Gist options
  • Select an option

  • Save nikitasinelnikov/5b619974bd30aa3cc18b59c0231a2d4e to your computer and use it in GitHub Desktop.

Select an option

Save nikitasinelnikov/5b619974bd30aa3cc18b59c0231a2d4e to your computer and use it in GitHub Desktop.
Ultimate Member: Show only address instead of google map iframe on the member directory
add_action( 'um_member_directory_before_query', 'my_custom_um_remove_googlemap' );
function my_custom_um_remove_googlemap() {
if ( ! empty( $_POST['directory_id'] ) ) {
$directory_id = UM()->member_directory()->get_directory_by_hash( $_POST['directory_id'] );
if ( $directory_id == '{your directory ID here}' ) {
remove_filter( 'um_profile_field_filter_hook__googlemap', 'um_profile_field_filter_hook__googlemap', 99 );
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment