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']
)
));