Shape the future of Social networking with WordPress: Join Project Midnight Sun! The next generation platform for community building with WordPress!

BuddyDev

Search

Replies

  • Keymaster
    (BuddyDev Team)
    Posts: 25496
    Brajesh Singh on in reply to: [Resolved] Profile Details Disappeared #42244

    Hi Jimmy,

    The problem is BuddyPress will not show any field on registration if you do not check “Users with no member type” in the each field setting.

    Also, if you are using latest version of BuddyPress, Please make sure you have this “Use this field in the site registration form.” checked too.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25496

    Hi David,
    Thank you for the details.

    In case of BuddyBoss, It is available from Dashboard->BuddyBoss->Profiles screen.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25496

    No problem Vlad. I am glad it was resolved 🙂

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25496

    Hi Cromacio,
    Thank you.
    I am sorry, we don’t have one for the free plugin.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25496
    Brajesh Singh on in reply to: [Resolved] Update the user xprofile field #42237

    Hi Vlad,
    Thank you for the kind words.

    I am glad it worked 🙂

    PS:- You are using the Group slug as Profile field name. I assume you have create an xprofile field for each of group.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25496
    Brajesh Singh on in reply to: User uploading on activity comments? #42236

    Thank you.
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25496

    Hi Robert,
    Thank you.

    These 2 plugins are not complementary. You can only use either BuddyCommerce or WooBuddy.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25496
    Brajesh Singh on in reply to: Custom page for user and group backgrounds. #42234
    This reply has been marked as private.
  • Keymaster
    (BuddyDev Team)
    Posts: 25496
    Brajesh Singh on in reply to: [Resolved] Update the user xprofile field #42222

    Hi Vlad,

    The code to update will have 2 parts. A form and a handler. The form is placed somewhere in your group screen and the handler code should be in your theme’s functions.php.

    Here is your form updated slightly.

    
        <form id="myform" method='post' action="">
    
            <select id="mylogins" name="mylogins" class='livesearch' required>
    
                <option value="">Please select login</option>
    
    			<?php if ( bp_group_has_members( bp_ajax_querystring( 'group_members' ) ) ) : ?>
    				<?php
    				while ( bp_group_members() ) :
    					bp_group_the_member();
    					?>
                        <option value='<?php echo bp_get_member_user_id(); ?>'><?php bp_member_user_nicename(); ?><?php bp_group_member_name(); ?></option>
    				<?php endwhile; ?>
    
    			<?php endif; ?>
    			<?php $group_id = bp_get_group_id( groups_get_current_group() ); ?>
            </select>
            <input type="hidden" name="group-meta-form-group-id" value="<?php echo esc_attr( $group_id ); ?>">
            <input type="text" placeholder="Enter value" name="my-field-name" required>
    
    		<?php wp_nonce_field( '_group_meta_update_' . $group_id, '_group_meta_update_nonce' ); ?>
            <input type="submit" id="myform" value="Save">
        </form>
    

    and here is the handler code

    
    
    add_action( 'bp_actions', function () {
    	// make sure it is our form submission.
    	if ( ! isset( $_POST['group-meta-form-group-id'] ) ) {
    		return;
    	}
    
    	$field = 'My Field Name'; // Please Update it with Your Xprofile field id or name.
    	// Only logged users can access it.
    	if ( ! is_user_logged_in() ) {
    		return;
    	}
    
    	$grooup_id = absint( $_POST['group-meta-form-group-id'] );
    	if ( ! $grooup_id || ! wp_verify_nonce( $_POST['_group_meta_update_nonce'], '_group_meta_update_' . $grooup_id ) ) {
    		return;
    	}
    
    	$selected_user_id = isset( $_POST['mylogins'] ) ? absint( wp_unslash( $_POST['mylogins'] ) ) : 0;
    
    	if ( ! $selected_user_id || ! get_user_by( 'id', $selected_user_id ) ) {
    		return;
    	}
    
    	$logged_user_id = get_current_user_id();
    
    	if ( is_super_admin( $logged_user_id ) || groups_is_user_admin( $logged_user_id, $grooup_id ) || groups_is_user_mod( $logged_user_id, $grooup_id ) ) {
    		// update profile.
    
    		$value = isset( $_POST['my-field-name'] ) ? sanitize_text_field( wp_unslash( $_POST['my-field-name'] ) ) : '';
    
    		if ( empty( $value ) ) {
    			xprofile_delete_field_data( $field, $selected_user_id );
    		} else {
    			xprofile_set_field_data( $field, $selected_user_id, $value );
    		}
    		bp_core_add_message( __( 'Updated successfully.', 'some -text-domain' ), 'success' );
    	}
    } );
    

    I haven’t tested it but I hope they will work fine.

    Please give it a try and adapt as you need it.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25496
    Brajesh Singh on in reply to: User uploading on activity comments? #42220

    Hi Akagi,
    Thank you for the question.
    I am sorry, it is not available currently. We do hope to ship it by the end of next year January.

    Regards
    Brajesh