Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • @ottolini

    Participant

    If anyone is looking for a plugin to allow members to select his/her own member type at registration, I just released one that just do that: https://github.com/mottolini/buddypress-xprofile-member-type-field
    It creates a new field type, called Member Type, that you can use to create a new field to add in the Base Group. During the registration it assign automatically the member type at the user. Member type cannot be changed after registration (it’s a feature, not a bug).
    Leave a comment here or open an issue on github.

    @ottolini

    Participant

    I’m currently developing a json API interface to BuddyPress based on on the BP-API project. I understand that this should not happen if a member uses the “normal” web interface, but if you access Buddypress functions through an API, like a mobile app, this could happen.
    So, from my point of view, there are two solutions:

    1) change the behaviour of friends_add_friend function so that if somebody ask for a friendship with someone that did the same in the past, just make the friendship happen because this is the implied action the member wanted to achieve
    2) modify the behaviour of get_friendship_id as suggested earlier

    Of course I’m open to any other suggestion…

    @ottolini

    Participant

    I was able to implement validation, creating a hook on bp_signup_pre_validate, with something like that:

    
    function myplugin_bp_signup_pre_validate() {
      global $bp;
    
      if (!myvalidationfunction($_POST['field_XX'])) {
        $bp->signup->errors['field_XX'] = 'My validation error message';
      }
    }
    
    add_action ('bp_signup_pre_validate', 'myplugin_bp_signup_pre_validate', 20);
    

    Obviously you have to use the correct number for the field(s) you want to validate instead of “XX”: look at the code of the page to identify the correct name of your XProfile field(s).

Viewing 3 replies - 1 through 3 (of 3 total)
Skip to toolbar