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

    You are most welcome!

  • Keymaster
    (BuddyDev Team)
    Posts: 25275
    Brajesh Singh on in reply to: BP Clear Notifications not working #8609

    Thank you Gregg. Our community will appreciate that.

  • Keymaster
    (BuddyDev Team)
    Posts: 25275

    Thank you for the appreciation Gregg.

    I am glad I was able to help 🙂

  • Keymaster
    (BuddyDev Team)
    Posts: 25275
    Brajesh Singh on in reply to: BP Clear Notifications not working #8604

    It is quiet possible. Please post the message with the error to them and they should be able to helps.

    It is related to access protection and something is triggering it on the server.

  • Keymaster
    (BuddyDev Team)
    Posts: 25275

    Hi Gregg,
    Thank you for the kind words and joining our premium membership.

    Here is the code that you can put in your bp-custom.php to skip the group

    
    
    /**
     * Skip a group from the group notifications.
     *
     * @param bool $skip true to skip notification.
     * @param BP_Activity_Activity $activity current activity instance.
     *
     * @return bool true to skip.
     */
    function buddydev_skip_group_from_notification( $skip, $activity ) {
    
    	$group_id = $activity->item_id;
    	//change the group id
    	if ( $group_id == 3 ) { //Please change '3' with your group id
    		$skip = true; //skip
    	}
    
    	return $skip;
    }
    add_filter( 'bp_local_group_notifier_skip_notification', 'buddydev_skip_group_from_notification', 10, 2 );
    
    

    Please change the group id with yours.

    Let me know if it works for you or not?

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25275
    Brajesh Singh on in reply to: BP Clear Notifications not working #8601

    Hi Gregg,
    Thank you for posting.
    if that is the error, it means your admin-ajax.php is not available due to access restrictions.

    Are you using any privacy plugin or some code to limit access to admin area?

  • Keymaster
    (BuddyDev Team)
    Posts: 25275

    Hi Tosin,
    about your last question.

    It is difficult to disable based on the member types as the member type is registered too late.

    Ravi & I looked at it and we found that we can disable the component conditionally but not using member type as context./ if using the user roles as context will work for you please let us know and we will post the code.

    Thank you
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25275

    Posted a solution there.

  • Keymaster
    (BuddyDev Team)
    Posts: 25275

    Hi,
    Please use the following code in bp-custom.php

    
    
    /**
     * Disable add friends button fro admin users
     *
     * it is an example and not recommended. It can cause n extra queries due to capability checking on the members loop.
     *
     * @param $button
     *
     * @return mixed
     */
    function buddydev_hide_admin_friends_button( $button ) {
    
    	if( ! isset( $button['id'] ) || $button['id'] != 'not_friends' ) {
    		return $button;
    	}
    
    	$user_id = absint( str_replace( 'friend-','', $button['link_id'] ) );
    	if ( ! $user_id ) {
    		return $button ;
    	}
    
    	//we can check using is_super_admin( $user_id ) || user_can( $user_id, 'cap' )
    
    	if ( user_can( $user_id, 'manage_options' ) ) {
    		$button['id'] = false;
    	}
    
    	return $button;
    }
    add_filter( 'bp_get_add_friend_button', 'buddydev_hide_admin_friends_button' );
    
    

    Please do note that it will cause n extra queries on the members loop.

    Regards
    Brajesh

  • Keymaster
    (BuddyDev Team)
    Posts: 25275

    Hi dandy,
    Thank you for posting.

    Please put teh following code in your css file

    
    #activity-stream li .activity-content  a.activity-time-since {
    	color: red !important; /** change with your own color*/
    }
    
    

    change the color with your preferred color and it will work.

    Regards
    Brajesh