Skip to:
Content

BuddyPress.org

Changeset 13909


Ignore:
Timestamp:
06/06/2024 09:34:30 PM (2 years ago)
Author:
dcavins
Message:

Change bp_user_has_opted_out() behavior.

Our function bp_user_has_opted_out() should return false if no email address is provided.

The underlying issue is that if you pass no where filter arguments to BP_Optout:: optout_exists() (which uses BP_Optout::get()), you get every optout back, which is the wrong answer in this case.

Props emeralive.

Fixes #9172.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-functions.php

    r13908 r13909  
    47874787 */
    47884788function bp_user_has_opted_out( $email_address = '' ) {
     4789        if ( ! $email_address ) {
     4790                return false;
     4791        }
    47894792        $optout_class = new BP_Optout();
    47904793        $optout_id    = $optout_class->optout_exists(
Note: See TracChangeset for help on using the changeset viewer.