Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dwanjuki/b555c486e33586549f30a2e030b9f010 to your computer and use it in GitHub Desktop.
Save dwanjuki/b555c486e33586549f30a2e030b9f010 to your computer and use it in GitHub Desktop.
Removes the Hide From Directory field added by PMPro Member Directory
<?php
// Copy from below here...
/**
* Remove the 'Hide From Directory' option from user profiles
* Add the following function to your PMPro Customizations plugin
* http://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*/
function my_pmpromd_remove_extra_profile_fields() {
// Remove showing...
remove_action( 'show_user_profile', 'pmpromd_show_extra_profile_fields' );
remove_action( 'edit_user_profile', 'pmpromd_show_extra_profile_fields' );
remove_action( 'pmpro_show_user_profile', 'pmpromd_show_extra_profile_fields' );
// Remove saving...
remove_action( 'personal_options_update', 'pmpromd_save_extra_profile_fields' );
remove_action( 'edit_user_profile_update', 'pmpromd_save_extra_profile_fields' );
remove_action( 'pmpro_personal_options_update', 'pmpromd_save_extra_profile_fields' );
}
add_action( 'init', 'my_pmpromd_remove_extra_profile_fields' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment