Forked from dparker1005/my_pmpromd_remove_extra_profile_fields.php
Last active
October 4, 2023 08:25
-
-
Save dwanjuki/b555c486e33586549f30a2e030b9f010 to your computer and use it in GitHub Desktop.
Removes the Hide From Directory field added by PMPro Member Directory
This file contains hidden or 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 | |
// 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