Problem when saving custom field data from the registration form

I created a plugin to add a field called password, gave it right it appears. The problem is that you are not writing the data. What am I doing wrong?

<?php
// output the form field
add_action(‘register_form’, ‘ad_register_fields’);
function ad_register_fields() {
?>
<p>
<label for=”password”><?php _e(‘Senha’) ?><br />
<input type=”password” name=”password” id=”password” class=”input” value=”<?php echo esc_attr($_POST[‘password’]); ?>” size=”25″ tabindex=”20″ />
</label>
</p>
<?php
}

add_filter(‘pre_user_password’, ‘ad_user_password’);
function ad_user_password($password) {
if (isset($_POST[‘password’])) {
$password = $_POST[‘password’];
}
return $password;
}
?>

Read more here:: Problem when saving custom field data from the registration form

Leave a Reply

Your email address will not be published. Required fields are marked *