Skip to:
Content

Opened 5 weeks ago

Last modified 4 weeks ago

#8081 new defect (bug)

BuddyPress breaks disabling notification for new users

Reported by: zodiac1978 Owned by:
Milestone: Awaiting Contributions Priority: normal
Severity: normal Version:
Component: Members Keywords: good-first-bug
Cc:

Description

I've written a blog post about the problem (in German) here:
https://torstenlandsiedel.de/2018/09/13/benachrichtigungsmails-fuer-admins-abstellen/

Please see these tickets for more details:
https://core.trac.wordpress.org/ticket/36009#comment:14
https://buddypress.trac.wordpress.org/ticket/7597#comment:7

Summary:
Sine WordPress 4.6 wp_send_new_user_notifications has a new parameter which sets up who should get the notification. Default is both (user and admin). You can remove this function via remove_action and re-add a new function which has the default changed to user instead to disable the admin notification.

The problem is that BuddyPress didn't know this and makes its own thing in bp-members-functions.php:

<?php
if ( apply_filters( 'bp_core_send_user_registration_admin_notification', true ) ) {
    wp_new_user_notification( $user_id );
}

It did not use the third parameter and adds a different way to disable the notification via filter.

So you need an additional filter to disable it:

<?php
add_filter( 'bp_core_send_user_registration_admin_notification', '__return_false' );

Change History (1)

#1 @r-a-y
4 weeks ago

  • Component changed from Core to Members
  • Keywords good-first-bug added
  • Milestone changed from Awaiting Review to Awaiting Contributions
Note: See TracTickets for help on using tickets.