BuddyDev

Search

Replies

  • Participant
    Level: Enlightened
    Posts: 53
    Jennifer on in reply to: bp_core_signup_user set a role #27017

    Hi Brajesh, thanks for your kindness.
    I thought I understood your explanation but something doesn’t work, can you see it where it failed? Thanks very much!!

    add_action('quform_post_process_7', function (array $result, Quform_Form $form) {
    if (function_exists('bp_core_signup_user')) {
        $username = $form->getValueText('quform_7_6');
        $email = $form->getValueText('quform_7_6');
        $password = $form->getValueText('quform_7_7');
    
        // XProfile fields
           $usermeta = array(
                 'field_1' => $form->getValueText('quform_7_10'),
                   //correo
                 'field_43' => $form->getValueText('quform_7_6'),
            );
    
                 $usermeta['profile_field_ids'] = '1,43';
            $usermeta['password'] = wp_hash_password($password);
       
    
     bp_core_signup_user($username, $password, $email, $usermeta, $user_id);
    update_user_meta( $user_id, 'shop_manager', $new_value );
    }
    
        return $result;
    }, 10, 2);
    
    function after_bp_activated_user($user_id, $key, $user) {
        $user = get_userdata($user_id);
        
        $role = get_user_meta($user_id, 'shop_manager');
        if ($role) {
            $user->set_role($role[0]);
        }
    }
    add_filter('bp_core_activated_user',  'after_bp_activated_user', 30, 2);
  • Participant
    Level: Enlightened
    Posts: 53
    Jennifer on in reply to: bp_core_signup_user set a role #27008

    Thank you Brajesh! is there a way to join it to a function to determine that role only for those new users? because I tried but it changes the role in the other registers
    Récords
    Jennifer

  • Participant
    Level: Enlightened
    Posts: 53
    Jennifer on in reply to: Custom values multiple selection box #26725

    Thanks Brajesh! i hope resolve it! Regards!

  • Participant
    Level: Enlightened
    Posts: 53
    Jennifer on in reply to: Custom values multiple selection box #26722

    HI! Can I serialize it if the form format is based on repeater fields? that is, I don’t have the number of options to put in the array.

  • Participant
    Level: Enlightened
    Posts: 53
    Jennifer on in reply to: Custom values multiple selection box #26720

    Hi Brajesh. thanks for your answer!
    No, it isnt.do you mean add something like that?

    $(document).ready(function(){
      $("button").click(function(){
        $("div").text($("form").serialize());
      });
    }); 

    I m thinking that the answer is generate like a repeater fields in xprofile but i didnt know how i can begin

  • Participant
    Level: Enlightened
    Posts: 53
    Jennifer on in reply to: [Resolved] Distance of members #26634

    Hi i used the plugin bp-search with this code:

    https://wordpress.org/support/topic/autocomplete-the-location/
    Regards!

  • Participant
    Level: Enlightened
    Posts: 53
    Jennifer on in reply to: [Resolved] Distance of members #26490

    Thank you very much Brajesh I am close to being able to do it.
    If I succeed, i post it here. Regards!

  • Participant
    Level: Enlightened
    Posts: 53
    Jennifer on in reply to: [Resolved] Distance of members #26449

    Sure I am making a web that a person answer questions and with his answer he automatically registers.
    Then I redirect it to show the closest members that appear geographically and similar xprofile It would be like a suggestion of friendship by location and xprofile.

    i hope you can understand me.
    Thanks!!

  • Participant
    Level: Enlightened
    Posts: 53
    Jennifer on in reply to: [Resolved] Hide tabs and profile for custom roles #26083
    This reply has been marked as private.
  • Participant
    Level: Enlightened
    Posts: 53
    Jennifer on in reply to: [Resolved] Redirect subpage of members #25509

    excellent!! thanks very much Brajesh!
    Regards,