Ask logged in user to re-enter password to access page “x”

You have to get user’s hash (hash is encrypted password) from the database:

get_currentuserinfo();

$user_hash = $current_user->user_pass_md5;

Then check if it’s correct:

wp_check_password( $password, $user_hash, $user_id );

$password – Plaintext user’s password from input

$user_hash – Encrypted password from database

$user_id – user ID I guess


But as Mark said in comment – this is extremely bad idea. User has already logged in and entered his/her password. Have you ever had to instert your password multiple times in here? Facebook? Gmail? No, because it’s not a good idea. Even banks don’t do it unless your session times out.