Replies
Hi Jennifer,
Thank you for sharing the code.I have updated it slightly and it should work.
add_action( 'quform_post_process_7', function ( array $result, Quform_Form $form ) { if ( ! function_exists( 'bp_core_signup_user' ) ) { return; } $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 ); $user_id = bp_core_signup_user( $username, $password, $email, $usermeta ); if ( $user_id ) { update_user_meta( $user_id, '_is_shop_manager', 1 ); } return $result; }, 10, 2 ); function after_bp_activated_user( $user_id, $key, $user ) { $user = get_userdata( $user_id ); $role = 'shop_manager';// please changew ith correct role. $is_shopmanager = get_user_meta( $user_id, '_is_shop_manager', true ); if ( $is_shopmanager ) { $user->set_role( $role ); } } add_action( 'bp_core_activated_user', 'after_bp_activated_user', 30, 2 );Please make sure to use correct role in the 2nd function. Also, It will only work on non multisite installation as on multisite ‘bp_core_signup_user’ does not return the user id correctly(currently).
Regards
Brajesh- Brajesh Singh on December 14, 2019 at 5:20 am in reply to: [Resolved] BuddyPress Course Stats Widget #27024
Hi,
You are most probably using a LMS and that is causing it. Please look into your plugins list and see if there is anything related to LMS, try disabling it temporarily to try the customize again.If that resolves it, Please report to the plugin author.
Regards
Brajesh - Brajesh Singh on December 14, 2019 at 5:17 am in reply to: [Resolved] Hide in BuddyPress Activity ShortCode #27022
You are welcome.
- Brajesh Singh on December 12, 2019 at 3:54 pm in reply to: [Resolved] Hide in BuddyPress Activity ShortCode #27016
Thank you.
The problem is your theme uses dynamic context for the activity actions.
here is a solution(Though it may be problematic in future)
.bpas-shortcode-activities .activity-inner+div { display:none; }Regards
Brajesh - Brajesh Singh on December 12, 2019 at 2:45 pm in reply to: [Resolved] BuddyPress Profile Completion – User Roles #27013
Thank you for confirming. I am glad it worked 🙂
Regards
Brajesh - Brajesh Singh on December 12, 2019 at 2:45 pm in reply to: [Resolved] Hide in BuddyPress Activity ShortCode #27012
Hi Philippe,
That should have worked.if it did not, can you please link me to the site where I can see it(with a guest user account).
It should be a simple task.regards
Brajesh Hi Jennifer,
The bp_core_signup_user returns the user_id of the newly created user. You can store a meta and use that at the time of activation to check.Hope that helps.
Regards
Brajesh- Brajesh Singh on December 12, 2019 at 10:44 am in reply to: [Resolved] BuddyPress Profile Completion – User Roles #27007
You are welcome.
you may want to try something like this instead
add_filter( 'bp_force_profile_completion_skip_check', function ( $skip ) { $user_roles = wp_get_current_user()->roles; if ( in_array( 'donor', $user_roles, true ) ) { $skip = true; } return $skip; } );We need to get the role of current user. So, I have updated the code.
Regards
Brajesh Hi Jennifer,
thank you for the question.BuddyPress overrides the roles on user account activation.
Your best bet is to set role on ‘bp_core_activated_user’ action with priority 2 or lower.
Regards
Brajesh- Brajesh Singh on December 12, 2019 at 10:39 am in reply to: [Resolved] BP Featured Members Plugin's Theme Default Display View is not work as expect #27005
Thank you for the kind words.
I am glad it is resolved. No issues with reporting here.Also, thank you for the youtube link 🙂
Best regards
Brajesh