BuddyDev

Search

Replies

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] Code adjustment #37469

    Hello Tosin,

    Thank you for posting. Please give it try to the following code.

    
    /**
     * On first login
     *
     * @param string  $user_login User login.
     * @param WP_User $user       User object.
     *
     */
    function buddydev_redirect_on_first_login( $user_login, $user ) {
    
    	if ( ! function_exists( 'buddypress' ) ) {
    		return;
    	}
    
    	// check for user's last activity.
    	$last_activity = bp_get_user_last_activity( $user->ID );
    
    	if ( empty( $last_activity ) ) {
    // Redirect you custom page.
    		bp_core_redirect( bp_loggedin_user_domain() );
    	}
    }
    
    add_action( 'wp_login', 'buddydev_redirect_on_first_login', -1, 2 );
    
    

    Let me know if it works or not.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] BP member types pro not working #37433

    Hello Martin,

    Thank you for the acknowledgment. I am glad that I could help.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115

    Hello Carsten,

    Yes, It will surpass WordPress General settings and assign the role associated with the member type.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115

    Hello Carsten,

    Exactly, If you associate WordPress roles to the member types. Then, it will be auto-assigned to the user when his/her member type changed.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115

    Hello Carsten,

    Thank you for posting. BuddyPress introduced creating member and group types feature from within the plugin itself. You do not need this plugin anymore.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115

    Hello Paul,

    Thank you for using the plugin.

    1. What are the conditions you are setting up. Also, Let me know what are the field types of those fields you are using in making conditions.

    2. Please do let me know Is it normal user registration from the BuddyBoss Register form or something else.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] BP member types pro not working #37401

    Hello Martin,

    Please ignore my above message. I have updated the code in the plugin. Please upgrade and give it a shot.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] BP member types pro not working #37394

    Hello Martin,

    Please try to use the following code. It seems they are not handling array datatype while saving meta info of level.

    
    
    /**
     * Save meta
     *
     * @param int   $level_id Level id.
     * @param array $posted_data Posted data.
     */
    function buddydev_save_level_member_types( $level_id, $posted_data ) {
    
    	if ( ! isset( $posted_data['bp_member_types'] ) ) {
    		return;
    	}
    
    	\Indeed\Ihc\Db\Memberships::deleteOneMeta( $level_id, 'bp_member_types' );
    
    	\Indeed\Ihc\Db\Memberships::saveMeta( $level_id, 'bp_member_types', maybe_serialize( $posted_data['bp_member_types'] ) );
    }
    
    add_action( 'ihc_admin_edit_save_level_after_submit_form', 'buddydev_save_level_member_types', 10, 2 );
    
    

    Please make sure to save each level once and then check.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] BP member types pro not working #37392

    Hello Martin,

    Sorry for the delayed reply. I am looking into it and will update you at Day end.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115

    Hello Carsten,

    Thank you for the acknowledgment.

    Q. user with not member type field is mandatory for things to work?
    Yes, for the profile field to be visible on the registration page we need this.

    Regards
    Ravi