get current user password on the profile edit page

Question

I want to show users password on the admin profile page. I mean admin can see the other user password. I am using this code. but it shows a password for all user!

add_action(‘show_user_profile’, ‘extra_user_profile_fields’);
add_action(‘edit_user_profile’, ‘extra_user_profile_fields’);

function extra_user_profile_fields($user)
{
$user_info = get_userdata($user->ID);
 $wp_pass = $user_info->user_pass;

    if (current_user_can('administrator')) {
        ?>
            <tr>
                <th><label for="email"><?php _e("Password"); ?></label></th>
                <td>
                    <input type="text" name="pass" id="pass"
                           value="<?php $wp_pass; ?>"
                           class="regular-text"/><br/>
                </td>
            </tr>
        </table>
        <?php
    }
}

When I vardump(get_userdata($user->ID)) its show all information about the user correctly. but it shows the same user password for all user;

0
D.JCode 8 months 2020-12-10T05:10:31-05:00 0 Answers 24 views 0

Leave an answer

Browse
Browse