Hi @sociality,
Not out of the box, no. But you can hook into bbpnns_skip_topic_notification and bbpnns_skip_reply_notification and return true.
In your functions.php file, add the following (and complete it with the check author and role parts):
function sociality_skip_topic_notification( $bool, $forum_id, $topic_id ) {
// Fetch author for topic ID
// Check author forum role
// Set $bool to true if role matches what you want
return $bool;
}
add_filter( 'bbpnns_skip_topic_notification', 'sociality_skip_topic_notification', 10, 3 );
function sociality_skip_reply_notification( $bool, $forum_id, $topic_id, $reply_id ) {
// Fetch author for reply ID
// Check author forum role
// Set $bool to true if role matches what you want
return $bool;
}
add_filter( 'bbpnns_skip_reply_notification', 'sociality_skip_topic_notification', 10, 4 );
Cheers,
Vinny
I forgot to address the second question. You can disable the front-end notification by removing the hooks. If you have background notifications turned on, you can try this:
function sociality_turn_off_bbpnns_fe() {
$bbpnns = bbPress_Notify_NoSpam::bootstrap();
remove_action( 'bbp_new_topic', array( $bbpnns, 'bg_notify_new_topic'), 100 );
remove_action( 'bbp_new_reply', array( $bbpnns, 'bg_notify_new_reply'), 100 );
}
add_action( 'plugins_loaded', 'sociality_turn_off_bbpnns_fe', 10 );
But please test it in a staging/dev environment first.
Both seem really helfull! Thanks a lot. I will try them out and let you know!
I tried the second solution. I put it my functions.php but still the front end notification work 🙁 What I want is only from the wp-admin to be able to send notifications.
Thanks a lot for your help, really appreciate!
Hi Sociality,
I understand what you need. The code should have worked. Can you make sure it’s actually a bbpnns notification that you got and not some other plugin (such as bbPress core notifications)?
You can do that by turning off bbpnns and testing the notification from the front-end again.
Its’s been a while it seemed to work in a way. Not completely sure thought. I decided to do it another way for now and try again another time. Thanks for the effort!