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: 25400

    Hi George,
    The problem is component.

    Please use

    
    
    [mpp-uploader gallery_id=2581 component=sitewide]	          
    
    

    That will fix it.

    Let me know if it works or not?

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25400

    You are welcome 🙂

  • Keymaster
    (BuddyDev Team)
    Posts: 25400
    Brajesh Singh on in reply to: [Resolved] Hyperlink to edit profile #16514

    You are welcome. Glad that it worked 🙂

  • Keymaster
    (BuddyDev Team)
    Posts: 25400
    Brajesh Singh on in reply to: Lightbox not loading #16513

    Thank you Oscar.

    Please link me to the image. It’s strange. If we can reproduce it, I can certainly fix it.

  • Keymaster
    (BuddyDev Team)
    Posts: 25400
    Brajesh Singh on in reply to: Translation to spanish Media Rating #16512

    Hi Oscar,
    I have asked @ravisharma to look into it and assist you. He will help you further.

  • Keymaster
    (BuddyDev Team)
    Posts: 25400
    Brajesh Singh on in reply to: [Resolved] Xprofile show age in "members-loop" #16500

    You are welcome.

  • Keymaster
    (BuddyDev Team)
    Posts: 25400
    Brajesh Singh on in reply to: Creating galleries only to role admin #16499

    Hi Antonio,
    In that case, we will need to first create a function to test for role like this

    
    
    /**
     * Check if a user has given WordPress role.
     *
     * @param int    $user_id user.
     * @param string $role role.
     *
     * @return bool
     */
    function buddydev_user_has_role( $user_id, $role ) {
    	$user   = get_user_by( 'id', $user_id );
    
    	if ( empty( $user ) ) {
    		return false;
    	}
    
    	$user_roles = $user->roles;
    
    	if ( empty( $user_roles ) ) {
    		return false;
    	}
    
    	return in_array( $role, $user_roles, true );
    }
    
    

    And then, we can use it like below(I am only enabling for administrator in this case)

    
    
    /**
     * Only allow galleries for a certain role.
     *
     * @param bool   $is_active Can create gallery or not.
     * @param string $component Component name.
     * @param int    $component_id Component id.
     *
     * @return bool
     */
    function buddydev_enable_gallery_for_role_only( $is_active, $component, $component_id ) {
    
    	if ( 'members' == $component ) {
    		$is_active = buddydev_user_has_role( $component_id, 'administrator' ); // 'editor', 'contributor', 'subscriber'
    	}
    
    	return $is_active;
    }
    add_filter( 'mpp_is_enabled', 'buddydev_enable_gallery_for_role_only', 10, 3 );
    
    

    That will do it for you.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25400
    Brajesh Singh on in reply to: How add new type notification for BuddyPress? #16498

    Hi Max,
    Welcome to BuddyDev.

    You can use

    
    
    bp_notifications_add_notification();
    
    

    to add new type of notifications. Please do note that you will need to register a dummy component and notification callback to make it render the notification.

    From your post, It seems you are using some kind of task management plugin. My suggestion will be to ask the developer to add it. It should be a very simple task as they might have some of the notifications already there.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25400
    Brajesh Singh on in reply to: [Resolved] Hyperlink to edit profile #16497

    Hi Audiomonk,

    You can use

    get_edit_profile_url( $user_id)
    

    to get the profile edit link.

    In your case, you can use the following code

    
    
    echo "<li><a href='" . get_edit_profile_url( get_current_user_id() ) . "'>" . __( 'Edit my profile', 'clean-login' ) . "</a></li>";
    

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25400

    Hi George,
    Will it be feasible for you to share the temporary login details with me.

    It is very strange that the shortcode is behaving this way.