Password protected sites

The easier way can be have a group of users called teachers and give just the teacher’s group the permission to visit the page. There are many plugins for permission handling and grouping users so you’ll just need to search WordPress plugin repository. Just an example: groups plugin Another possible answer can be : multi … Read more

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 … Read more

lostpassword_redirect filter is not used

I was missing something. Woocommerce accounts are different from normal WordPress accounts. The code that I was looking for was: function woocommerce_new_pass_redirect( $user ) { wp_redirect( get_permalink(woocommerce_get_page_id(‘myaccount’))); exit; } add_action( ‘woocommerce_customer_reset_password’, ‘woocommerce_new_pass_redirect’ ); I found it on stackoverflow.

Change password fields

“Generate password” button, which you say “it is not the usual field”, is the standard since WordPress 4.3. You can click it and a new password is auto generated; if you don’t like it, you can modify it before saving changes and update the user data. So, your question is basically wrong assuming that fields … Read more

current user’s password check

You can use current_user_can() to check if the user has permission to edit a specific user. If that’s what you’re trying to do. You will need to get the relevant user ID though as the 2nd argument: if ( current_user_can( ‘edit_user’, $user_id ) ) { // Do stuff. } So you can send the relevant … Read more