Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save JarrydLong/3ef373fbf5e8fee4139d859cd7fa8234 to your computer and use it in GitHub Desktop.
Save JarrydLong/3ef373fbf5e8fee4139d859cd7fa8234 to your computer and use it in GitHub Desktop.
<?php
/**
* This recipe will remove the map from the directory and single profile pages
* when using the Membership Directory Add On
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function mypmpromm_remove_map_membership_directory(){
//Removes the map from the directory page
remove_action( 'pmpro_member_directory_before', 'pmpromm_load_map_directory_page', 10, 2 );
//Removes the map frm the single profile page
remove_action( 'pmpro_member_profile_before', 'pmpromm_show_single_map_profile', 10, 1 );
}
add_action( 'init', 'mypmpromm_remove_map_membership_directory' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment