Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/24/2009 10:05:01 PM (17 years ago)
Author:
apeatling
Message:

Merging 1.1 branch fixes into trunk.

File:
1 edited

Legend:

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

    r2088 r2114  
    332332        $blog_title = $filtered_results['blog_title'];
    333333        $errors = $filtered_results['errors'];
    334        
     334
    335335        if ( empty($blogname) )
    336336                $blogname = $user_name;
     
    567567        return false;
    568568}
    569 add_filter( 'wpmu_signup_blog_notification', 'bp_core_activation_signup_blog_notification', 1, 7 );
    570569
    571570function bp_core_activation_signup_user_notification( $user, $user_email, $key, $meta ) {
    572571        global $current_site;
    573572
     573        if( !apply_filters('wpmu_signup_user_notification', $user, $user_email, $key, $meta) )
     574                return false;
     575
    574576        // Send email with activation link.
    575577        $admin_email = get_site_option( "admin_email" );
    576578
    577         if ( empty( $admin_email ) )
     579        if ( $admin_email == '' )
    578580                $admin_email = 'support@' . $_SERVER['SERVER_NAME'];
    579581
    580         $from_name = ( '' == get_site_option( "site_name" ) ) ? 'WordPress' : wp_specialchars( get_site_option( "site_name" ) );
     582        $from_name = get_site_option( "site_name" ) == '' ? 'WordPress' : wp_specialchars( get_site_option( "site_name" ) );
    581583        $message_headers = "MIME-Version: 1.0\n" . "From: \"{$from_name}\" <{$admin_email}>\n" . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
    582         $message = apply_filters( 'wpmu_signup_user_notification_email', sprintf( __( "To activate your user, please click the following link:\n\n%s\n\nAfter you activate, you will receive *another email* with your login.\n\n", 'buddypress' ), clean_url( bp_activation_page( false ) . "?key=$key" ) ) );
    583         $subject = apply_filters( 'wpmu_signup_user_notification_subject', sprintf( __(  'Activate %s', 'buddypress' ), $user ) );
    584 
    585         wp_mail( $user_email, $subject, $message, $message_headers );
     584        $message = sprintf( apply_filters( 'wpmu_signup_user_notification_email', __( "To activate your user, please click the following link:\n\n%s\n\nAfter you activate, you will receive *another email* with your login.\n\n" ) ), site_url( "wp-activate.php?key=$key" ), $key );
     585
     586        // TODO: Don't hard code activation link.
     587        $subject = sprintf(__( apply_filters( 'wpmu_signup_user_notification_subject', 'Activate %s' )), $user);
     588        wp_mail($user_email, $subject, $message, $message_headers);
    586589
    587590        // Return false to stop the original WPMU function from continuing
    588591        return false;
    589592}
    590 add_filter( 'wpmu_signup_user_notification', 'bp_core_activation_signup_user_notification', 1, 4 );
     593
     594function bp_core_load_deprecated_signup_email_functions() {
     595        /* If we are using a BuddyPress 1.1+ theme ignore this. */
     596        if ( !file_exists( WP_CONTENT_DIR . '/bp-themes' ) )
     597                return false;
     598
     599        add_filter( 'wpmu_signup_user_notification', 'bp_core_activation_signup_user_notification', 1, 4 );
     600        add_filter( 'wpmu_signup_blog_notification', 'bp_core_activation_signup_blog_notification', 1, 7 );
     601}
     602add_action( 'plugins_loaded', 'bp_core_load_deprecated_signup_email_functions' );
    591603
    592604/*** END DEPRECATED SIGNUP FUNCTIONS **********/
Note: See TracChangeset for help on using the changeset viewer.