2

I have a custom post type that I would like to use to create a WP user with an action hook. Once a user has completed the form the hook should enter the basic information to begin registering a wp user i.e. username, password email.

This is the function I have so far but I don't know why it is not working.

function agency_add_tenant( $post_id) {
    $username = get_post_meta ( $post_id, 'username', true );
    $password = get_post_meta ( $post_id, 'password', true );
    $email_address = get_post_meta ( $post_id, 'email', true );

    $user_id = function wp_create_user( $username, $password, $email_address );

    // Email the user
    wp_mail( $email_address, 'Welcome!', 'Your Password: ' . $password );
}
Richard
  • 8,961
  • 3
  • 38
  • 47
Douro
  • 21
  • 2
  • 2
    just call the wp_create_user( $username, $password, $email_address ); no need to add function in front of function call. – Vidya L Nov 09 '15 at 07:06

0 Answers0