BuddyDev

Search

Replies

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: [Resolved] Predefined user gallery with display name #43833

    Hello Jacob,

    Welcome to the BuddyDev Forums.

    For creating a gallery with the title as the user display name. Replace the following string:

    
    __( 'Predefined Photo Gallery' )
    

    with

    
    bp_core_get_user_displayname( $user_id )
    

    Note: Please make sure comma(,) remain there

    And to restrict form edit gallery title use the following code:

    
    add_action( 'mpp_user_can_edit_gallery', function ( $can, $gallery, $user_id ) {
    
    	// Do not check if not allowed to edit gallery details.
    	if ( ! $can || $gallery->user_id != $user_id ) {
    		return $can;
    	}
    
    	// Do not allow to change the title.
    	if ( ! empty( $_POST['mpp-gallery-title'] ) && $gallery->title != $_POST['mpp-gallery-title'] ) {
    		$can = false;
    	}
    
    	return $can;
    } );
    
    

    Image from other sources you can use ‘mpp_add_media’ function to add to gallery please have a look at the function supported args.

    Regards
    Ravi

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

    Hello Arlo,

    Thank you for the acknowledgement. I have checked BuddyBoss edit activity functionality on my local server and it is working fine for me. Please have a look at the console window of your browser is there any error is showing or not. There might be a chance that some error is breaking the edit button behaviour.

    Regards
    Ravi

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

    Hello Anjan,

    Thank you for the acknowledgement. Yup, The Xprofile query is slow for the large data set. Can you please share the complete code so that I can give a better review?

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on in reply to: Custom notification #43820

    Hello Abhist,

    Thank you for posting. Please use the following code:

    
    
    add_action( 'bp_set_member_type', function ( $user_id, $member_type ) {
    	// $user_id     ID of the user whose member type has been updated.
    	// $member_type The member type name or an array of member type names.
    
    	$user = get_user_by( 'id', $user_id );
    
    	if ( ! $user ) {
    		return;
    	}
    
    	// Provide the email subject.
    	$subject = '';
    
    	// Provide the email message.
    	$message = '';
    
    	@wp_mail( $user->user_email, $subject, $message );
    } );
    

    Please check and let me know if it helps or not.

    Regards
    Ravi

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

    Hello Arlo,

    Welcome to the BuddyDev Forums.

    With BuddyBoss you do not need BuddyPress Editable Activity plugin as it does offer this functionality in the core. You can enable it from BuddyBoss > Settings > Activity > Edit Activity

    Please check

    Regards
    Ravi

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

    Hello Eric,

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

    We will update the plugin documentation in the next version.

    Regards
    Ravi

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

    Thank you for the acknowledgement.

    Regards
    Ravi

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

    Hello Anjan,

    Thank you for sharing the code. No need to add the ‘relation’ key to the Xprofile query.

    
    
    $args = array(
    	'member_type' => 'donor',
    	'xprofile_query' => array(
    		array(
    			'field_id' => $fieldID,
    			'value' => $arrayItems,
    			'compare' => 'IN',
    		),
    	),
    );
    
    

    You can directly pass this args to the member query. There is no need to create a User_Query instance. Modify the filter_args method from the above mention blog code.

    Regards
    Ravi

    • This reply was modified 3 years, 4 months ago by Ravi.
  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115

    Hello Tosin,

    Thank you for sharing. try the following code:

    
    add_filter( 'bp_core_send_user_registration_admin_notification', '__return_false' );
    

    Let me know if it helps or not.

    Regards
    Ravi

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

    Hello Anjan,

    Please have a look at the “BP_Xprofile_Queury” class. They have mentioned in the doc comment all supported args.

    https://github.com/buddypress/buddypress/blob/master/src/bp-xprofile/classes/class-bp-xprofile-query.php#L54

    You will have a better idea to use this. Please let me know if you need further assistance.

    Regards
    Ravi