BuddyDev

Search

[Resolved] Modifying bbPress Notify Admins

  • Participant
    Level: Enlightened
    Posts: 35
    xbladerunner on #42855

    I’d like to modify this to notify forum moderators instead of the site admins. Ideally the site admin could toggle this themselves via a new ui, but I’m just looking for a quick fix right now. I know there are other plugins for this, but would rather use this one, if possible.

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2459
    Ravi on #42891

    Hello,

    Sorry for the delayed reply. Please let me know are you talking about BuddyPress Moderation Tools and looking for a way to notify Forum moderators instead of site admins when there is a topic or reply reported for moderation.

    Please confirm.

    Regards
    Ravi

  • Participant
    Level: Enlightened
    Posts: 35
    xbladerunner on #42924

    No, I’m sorry I wasn’t more clear in my question. I’m talking about the “bbPress Notify Admins” plugin. I’m wondering how to modify it to notify moderators instead of admins.

    • This reply was modified 7 months, 4 weeks ago by xbladerunner.
  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2459
    Ravi on #42936

    Hello,

    Thank you for the acknowledgment. Please use the following code:

    
    /**
     * Modify Notifying users
     *
     * @return array
     */
    function buddydev_modify_notifying_users() {
    	return get_users( array( 'role__in' => array( 'bbp_moderator' ) ) );
    }
    add_filter( 'bbp_notify_admin_topic_notifiable_users', 'buddydev_modify_notifying_users' );
    add_filter( 'bbp_notify_admin_reply_notifiable_users', 'buddydev_modify_notifying_users' );
    
    

    It will notify forum moderators instead of Admins and Keymasters. Please let me know if helps or not.

    Regards
    Ravi

  • Participant
    Level: Enlightened
    Posts: 35
    xbladerunner on #42982

    Thank you, Ravi–
    The code works great!

    I chose to place in at the end of the following plugin file: class-email-notifier.php
    Thought about forking the plugin, but didn’t feel like separately maintaining it! I’ll just “rePatch” if/when there is ever another update to that file. I mention this in case anyone else reading this is wondering where to put the code. Thanks again for your help!

    • This reply was modified 7 months, 4 weeks ago by xbladerunner. Reason: clarifying where to put the code
  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2459
    Ravi on #42993

    Hello,

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

    You can put the code either in bp-custom.php if you are using BuddyPress or in the child theme functions.php file.

    What is the ‘bp-custom.php’ file have a look here?
    https://buddydev.com/docs/buddypress-guides/what-is-bp-custom-php/

    Regards
    Ravi

You must be logged in to reply to this topic.

This topic is: resolved