Created
January 21, 2020 21:12
-
-
Save kimcoleman/178f96dd86504f2ef1c28d0df4a2f4c9 to your computer and use it in GitHub Desktop.
Remove the "Membership Level" Edit Section from User Profile Edit if viewing the Profile from the frontend using a plugin like Theme My Login's Profiles Module.
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 | |
| /** | |
| * Remove the "Membership Level" Edit Section from User Profile Edit | |
| * if viewing the Profile from the frontend using a plugin like | |
| * Theme My Login's Profiles Module. | |
| * | |
| */ | |
| function remove_membership_level_profile_fields_on_frontend() { | |
| if ( ! is_admin() ) { | |
| remove_action( 'show_user_profile', 'pmpro_membership_level_profile_fields' ); | |
| remove_action( 'edit_user_profile', 'pmpro_membership_level_profile_fields' ); | |
| remove_action( 'personal_options_update', 'pmpro_membership_level_profile_fields_update' ); | |
| remove_action( 'edit_user_profile_update', 'pmpro_membership_level_profile_fields_update' ); | |
| } | |
| } | |
| add_action( 'init', 'remove_membership_level_profile_fields_on_frontend' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment