'GET', 'callback' => [$this, 'check_meta'], 'permission_callback' => '__return_true', ]); }); } public function check_meta() { $user_meta = get_user_meta(5, 'xs_password_changed'); } /** * ===================== * After login * ===================== */ public function after_login($user_login, $user) { $user_meta = get_user_meta($user->ID, 'xs_password_changed', true); /* ------------------------------------- Check if user is created by WP Social ------------------------------------- */ if($user_meta) { /** * Check if user changed the password. * If it says 'no' that means user did * not change the password so we should * loggout them */ if($user_meta == 'no') { wp_logout(); } } } /** * ====================================== * After password reset *======================================= */ public function after_password_rest() { $user_id = get_current_user_id(); /** If password does not change */ if(!isset($_POST['pass1']) || '' == $_POST['pass1']) { return; } $user_meta = get_user_meta($user_id, 'xs_password_changed', true); if($user_meta) { update_user_meta($user_id, 'xs_password_changed', 'yes'); } } }