Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)

  • michaelpfaff
    Participant

    @michaelpfaff

    I figured this out by cobbling together some code. Just copy this into a new .php file, upload to /plugins and activate. You’ll need to change ‘Referrer’ to whatever profile field you have instead.

    <?php
    /*
    Plugin Name: Custom New User Email
    Description: Changes the copy in the email sent out to new users
    */
     
    // Redefine user notification function
    if ( !function_exists('wp_new_user_notification') ) {
        function wp_new_user_notification( $user_id, $plaintext_pass = '' ) {
            $user = get_userdata( $user_id );
          
    	// The blogname option is escaped with esc_html on the way into the database in sanitize_option
    	// we want to reverse this for the plain text arena of emails.
    	$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
    	
    	// find the profile field for referrer
    	$field1 = xprofile_get_field_data( 'Referrer', $user_id );
    
    	$message  = sprintf(__('New user registration on your site %s:'), $blogname) . "\r\n\r\n";
    	$message .= sprintf(__('Username: %s'), $user->user_login) . "\r\n\r\n";
    	$message .= sprintf(__('E-mail: %s'), $user->user_email) . "\r\n\r\n";
    	$message .= sprintf(__('Referrer: %s'), $field1) . "\r\n";
    
    	@wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), $blogname), $message);
    
    	if ( empty($plaintext_pass) )
    		return;
    
    	$message  = sprintf(__('Username: %s'), $user->user_login) . "\r\n";
    	$message .= sprintf(__('Password: %s'), $plaintext_pass) . "\r\n";
    	$message .= wp_login_url() . "\r\n";
    
    	wp_mail($user->user_email, sprintf(__('[%s] Your username and password'), $blogname), $message);
     
         }
    }
     
    ?>

    michaelpfaff
    Participant

    @michaelpfaff

    Great. I’ll try a different theme and see if it speeds up.


    michaelpfaff
    Participant

    @michaelpfaff

    Dan, is there a way to count up the number of favorites for all activity and create a stream of “Most Favorited”?

Viewing 3 replies - 1 through 3 (of 3 total)
Skip to toolbar