Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter covoiturage

    (@covoiturage)

    Sorry, i wanted to say “how to automatically get the Username of a registered user” and not the email adress.

    Thanks again

    None of those give you the Current logged in user.

    Before you could add code to the file plugins/contact-form-7/modules/special-mail-tags.php I added this code:

    add_filter( 'wpcf7_special_mail_tags', 'wpcf7_special_mail_tag_userdata', 10, 2 );
    
    function wpcf7_special_mail_tag_userdata( $output, $name ) {
    
    	// For backwards compat.
    	$name = preg_replace( '/^wpcf7\./', '_', $name );
    
    	global $current_user;
    
    	if ( 'user_login' == $name )
    		$output = $current_user->user_login;
    
    	return $output;
    }

    But on 3.9 that file does not exist or at lease i can’t find it.
    We need to know how or where to add this code now.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to automatically get the user's email adress’ is closed to new replies.