BuddyDev

Search

[Resolved] Hide some profile field from Register Form

  • Participant
    Level: Initiated
    Posts: 10
    kalpesh on #8921

    Hi,
    By default the registration page shows the profile-fields of Basic (primary or first) profile group. Can I hide some specific profile field from this basic profile group only from register page?
    How to hide specific profile field from register page.

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2932
    Ravi on #8947

    Hello Kalpesh,

    Thank you for posting here. Please use the following code in your bp-custom.php file to hide fields on register page.

    
    function buddydev_filter_register_fields( $r ) {
    
    	if ( bp_is_register_page() ) {
    		$r['exclude_fields'] = 2;  // Comma-separated list of profile field IDs to exclude.
    	}
    
    	return $r;
    }
    add_filter('bp_after_has_profile_parse_args','buddydev_filter_register_fields' );
    
    

    Thank You
    Ravi

  • Participant
    Level: Initiated
    Posts: 10
    kalpesh on #8967

    Thanks a lot.

    This is working for only one value. Means
    $r[‘exclude_fields’] = 2; is working.

    $r[‘exclude_fields’] = 2,3; not working. showing
    Parse error: syntax error, unexpected ‘,’

  • Keymaster
    (BuddyDev Team)
    Posts: 24190
    Brajesh Singh on #8968

    You should use

    
    $r['exclude_fields'] = '2,3';// It should be inside the quote.
    
    

    Hope that helps.

  • Participant
    Level: Initiated
    Posts: 10
    kalpesh on #8970

    Thank a ton.
    It worked.

  • Keymaster
    (BuddyDev Team)
    Posts: 24190
    Brajesh Singh on #8971

    You are welcome!

The topic ‘ [Resolved] Hide some profile field from Register Form’ is closed to new replies.

This topic is: resolved