BuddyDev

Search

[Resolved] Group Activities Notifier when Admin/Moderator

  • Participant
    Level: Initiated
    Posts: 5
    Occhi on #51418

    Hello,

    The plugin “BuddyPress Group Activities Notifier” works like a charm, thank you.
    I would like notifer all members of a group only if admin or moderator publish something.

    Is that possible ?

    Thank you

  • Keymaster
    (BuddyDev Team)
    Posts: 24577
    Brajesh Singh on #51422

    Hi,
    Welcome to BuddyDev support forums.

    Please put this code in your bp-custom.php

    
    
    function bpcustom_only_enable_for_group_admin_mod_posts( $stop_notification, $activity ) {
    
    	$group_id  = $activity->item_id;
    	$logged_id = get_current_user_id();
    	if ( ! groups_is_user_admin( $logged_id, $group_id ) && ! groups_is_user_mod( $logged_id, $group_id ) ) {
    		$stop_notification = true;
    	}
    	
    	return $stop_notification;
    }
    
    add_filter( 'bp_local_group_notifier_skip_notification', 'bpcustom_only_enable_for_group_admin_mod_posts', 10, 2 );
    
    

    That will limit it to group admin/mods.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 5
    Occhi on #51434

    Thank you Brajesh !!

  • Keymaster
    (BuddyDev Team)
    Posts: 24577
    Brajesh Singh on #51451

    You are welcome!

The topic ‘ [Resolved] Group Activities Notifier when Admin/Moderator’ is closed to new replies.

This topic is: resolved