Skip to main content
replaced http://wordpress.stackexchange.com/ with https://wordpress.stackexchange.com/
Source Link

I'm trying to output the password of a newly created user in plain text using the user_register hook as explained in this answerin this answer. However, upon doing a var_dump of $_POST, I don't see any password output. Can user_register actually do this?

If not, might you have any ideas on a hook that would do this for a new user?

Thanks for any insight!

Edit: Below is the code that I'm using, along with the var_dump
The code that I'm using for the password is from this accepted answerthis accepted answer.

add_action('user_register', 'registration_save');

function registration_save($user_id){
    global $wpdb;
    echo "user saved";
    ob_start();
    var_dump($_POST);
    $result = ob_get_clean();
    echo file_put_contents("file_put_test.txt","Hello World".$result."Password: ".$_POST['pass1']);
    $result = $wpdb->query($wpdb->prepare("REPLACE INTO test
                                          (user,newpass)
                                          values(%s,%s)",
                                          array(
                                              $_POST['username'],
                                              $_POST['pass1']
                                            )
    ));

I'm trying to output the password of a newly created user in plain text using the user_register hook as explained in this answer. However, upon doing a var_dump of $_POST, I don't see any password output. Can user_register actually do this?

If not, might you have any ideas on a hook that would do this for a new user?

Thanks for any insight!

Edit: Below is the code that I'm using, along with the var_dump
The code that I'm using for the password is from this accepted answer.

add_action('user_register', 'registration_save');

function registration_save($user_id){
    global $wpdb;
    echo "user saved";
    ob_start();
    var_dump($_POST);
    $result = ob_get_clean();
    echo file_put_contents("file_put_test.txt","Hello World".$result."Password: ".$_POST['pass1']);
    $result = $wpdb->query($wpdb->prepare("REPLACE INTO test
                                          (user,newpass)
                                          values(%s,%s)",
                                          array(
                                              $_POST['username'],
                                              $_POST['pass1']
                                            )
    ));

I'm trying to output the password of a newly created user in plain text using the user_register hook as explained in this answer. However, upon doing a var_dump of $_POST, I don't see any password output. Can user_register actually do this?

If not, might you have any ideas on a hook that would do this for a new user?

Thanks for any insight!

Edit: Below is the code that I'm using, along with the var_dump
The code that I'm using for the password is from this accepted answer.

add_action('user_register', 'registration_save');

function registration_save($user_id){
    global $wpdb;
    echo "user saved";
    ob_start();
    var_dump($_POST);
    $result = ob_get_clean();
    echo file_put_contents("file_put_test.txt","Hello World".$result."Password: ".$_POST['pass1']);
    $result = $wpdb->query($wpdb->prepare("REPLACE INTO test
                                          (user,newpass)
                                          values(%s,%s)",
                                          array(
                                              $_POST['username'],
                                              $_POST['pass1']
                                            )
    ));
Tweeted twitter.com/#!/StackWordPress/status/386283744187129856
added code
Source Link

I'm trying to output the password of a newly created user in plain text using the user_register hook as explained in this answer. However, upon doing a var_dump of $_POST, I don't see any password output. Can user_register actually do this?

If not, might you have any ideas on a hook that would do this for a new user?

Thanks for any insight!

Edit: Below is the code that I'm using, along with the var_dump
The code that I'm using for the password is from this accepted answer.

add_action('user_register', 'registration_save');

function registration_save($user_id){
    global $wpdb;
    echo "user saved";
    ob_start();
    var_dump($_POST);
    $result = ob_get_clean();
    echo file_put_contents("file_put_test.txt","Hello World".$result."Password: ".$_POST['pass1']);
    $result = $wpdb->query($wpdb->prepare("REPLACE INTO test
                                          (user,newpass)
                                          values(%s,%s)",
                                          array(
                                              $_POST['username'],
                                              $_POST['pass1']
                                            )
    ));

I'm trying to output the password of a newly created user in plain text using the user_register hook as explained in this answer. However, upon doing a var_dump of $_POST, I don't see any password output. Can user_register actually do this?

If not, might you have any ideas on a hook that would do this for a new user?

Thanks for any insight!

I'm trying to output the password of a newly created user in plain text using the user_register hook as explained in this answer. However, upon doing a var_dump of $_POST, I don't see any password output. Can user_register actually do this?

If not, might you have any ideas on a hook that would do this for a new user?

Thanks for any insight!

Edit: Below is the code that I'm using, along with the var_dump
The code that I'm using for the password is from this accepted answer.

add_action('user_register', 'registration_save');

function registration_save($user_id){
    global $wpdb;
    echo "user saved";
    ob_start();
    var_dump($_POST);
    $result = ob_get_clean();
    echo file_put_contents("file_put_test.txt","Hello World".$result."Password: ".$_POST['pass1']);
    $result = $wpdb->query($wpdb->prepare("REPLACE INTO test
                                          (user,newpass)
                                          values(%s,%s)",
                                          array(
                                              $_POST['username'],
                                              $_POST['pass1']
                                            )
    ));
Source Link

Can user_register output the password?

I'm trying to output the password of a newly created user in plain text using the user_register hook as explained in this answer. However, upon doing a var_dump of $_POST, I don't see any password output. Can user_register actually do this?

If not, might you have any ideas on a hook that would do this for a new user?

Thanks for any insight!