Skip to:
Content

BuddyPress.org

Changeset 10598


Ignore:
Timestamp:
02/16/2016 03:37:51 PM (9 years ago)
Author:
djpaul
Message:

Emails: reinstate missing filters for backwards compatibility.

The user registration and site registration functions (multisite and non-multisite paths) were consolidated as part of the email implementation in 2.5, but the different filter names were overlooked.
This change will restore compatibility for those old actions.

Fixes #6917

Props imath

File:
1 edited

Legend:

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

    r10595 r10598  
    205205
    206206    } elseif ( $email_type === 'core-user-registration' ) {
     207        // Filters are different according to the WordPress config.
     208        if ( is_multisite() ) {
     209            $registration_filters = array(
     210                'to'      => 'bp_core_activation_signup_user_notification_to',
     211                'subject' => 'bp_core_activation_signup_user_notification_subject',
     212                'content' => 'bp_core_activation_signup_user_notification_message',
     213            );
     214        } else {
     215            $registration_filters = array(
     216                'to'      => 'bp_core_signup_send_validation_email_to',
     217                'subject' => 'bp_core_signup_send_validation_email_subject',
     218                'content' => 'bp_core_signup_send_validation_email_message',
     219            );
     220        }
     221
    207222        if ( $property === 'to' ) {
    208223            /**
     
    219234             * @param array $meta            Removed in 2.5; now an empty array.
    220235             */
    221             $value = apply_filters( 'bp_core_activation_signup_user_notification_to', $value, $tokens['recipient.name'], $value, $tokens['key'], array() );
     236            $value = apply_filters( $registration_filters['to'], $value, $tokens['recipient.name'], $value, $tokens['key'], array() );
    222237
    223238        } elseif ( $property === 'subject' ) {
     
    234249             * @param array $meta             Removed in 2.5; now an empty array.
    235250             */
    236             $value = apply_filters( 'bp_core_activation_signup_user_notification_subject', $value, $tokens['recipient.name'], $tokens['recipient.email'], $tokens['key'], array() );
     251            $value = apply_filters( $registration_filters['subject'], $value, $tokens['recipient.name'], $tokens['recipient.email'], $tokens['key'], array() );
    237252
    238253        } elseif ( $property === 'content' ) {
     
    249264             * @param array $meta             Removed in 2.5; now an empty array.
    250265             */
    251             $value = apply_filters( 'bp_core_activation_signup_user_notification_message', $value, $tokens['recipient.name'], $tokens['recipient.email'], $tokens['key'], array() );
     266            $value = apply_filters( $registration_filters['content'], $value, $tokens['recipient.name'], $tokens['recipient.email'], $tokens['key'], array() );
    252267        }
    253268
Note: See TracChangeset for help on using the changeset viewer.