wordpress custom password change problem

the problem is with your cookies.wp_update_user function is trying to change them after all headers were sent, try to use such code like that: function my_func(){ // your code } add_action(‘init’,’my_func’);

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.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)