Filter and limit member types only in registration form

  • Participant
    Andreas P. on #44996

    I use this filter function buddydev_filter_allowed_xprofile_member_types() found here https://buddydev.com/plugins/bp-xprofile-member-type-field/.

    What can I do in order to set filter only on registration page and not on users’ profile page? I would like to set filter only once on registration..

    Thank you!


  • Keymaster
    (BuddyDev Team)
    Posts: 24308
    Brajesh Singh on #45004

    Hi Andreas,
    Welcome to BuddyDev support forums.
    Thank you for the question.

    Please use the following code

        add_filter( 'bp_xprofile_member_type_field_allowed_types', function( $member_types ) {
    	    if ( ! bp_is_register_page() ) {
    		    return $member_types;
            // we are on signup page.
            // do something with member types(add/remove).
            return $member_types;

    You can adapt it as you need.


You must be logged in to reply to this topic.

This topic is: not resolved