Skip to:
Content

BuddyPress.org

Ticket #6917: 6917.patch

File 6917.patch, 2.9 KB (added by imath, 9 years ago)
  • src/bp-core/deprecated/2.5.php

    diff --git src/bp-core/deprecated/2.5.php src/bp-core/deprecated/2.5.php
    index fcf5ea9..ee93f4d 100644
    function bp_core_deprecated_email_filters( $value, $property, $transform, $email 
    204204                }
    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                        /**
    209224                         * Filters the email that the notification is going to upon successful registration without blog.
    function bp_core_deprecated_email_filters( $value, $property, $transform, $email 
    218233                         * @param string $key            The activation key created in wpmu_signup_blog().
    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' ) {
    224239                        /**
    function bp_core_deprecated_email_filters( $value, $property, $transform, $email 
    233248                         * @param string $key             The activation key created in wpmu_signup_blog().
    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' ) {
    239254                        /**
    function bp_core_deprecated_email_filters( $value, $property, $transform, $email 
    248263                         * @param string $key             The activation key created in wpmu_signup_blog().
    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
    254269        } elseif ( $email_type === 'core-user-registration-with-blog' ) {