Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function bpfr_hide_profile_edit( $retval ) {
- // remove field from edit tab
- if( bp_is_profile_edit() ) {
- $retval['exclude_fields'] = '54'; // ID's separated by comma
- }
- // allow field on register page
- if ( bp_is_register_page() ) {
- $retval['include_fields'] = '54'; // ID's separated by comma
- }
- // hide the field on profile view tab
- if ( $data = bp_get_profile_field_data( 'field=54' ) ) :
- $retval['exclude_fields'] = '54'; // ID's separated by comma
- endif;
- return $retval;
- }
- function sqr_hide_x_custom_profile() {
- if (!pmpro_has_membership_access()) {
- add_filter('bp_after_has_profile_parse_args', 'bpfr_hide_profile_edit');
- }
- }
- add_action('init', 'sqr_hide_x_custom_profile');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement