Files
ogre-captcha/inc/location/class-lost-password-form.php
T
Cooper Dalrymple e8b8fc1871
Validate Build / validate-build (push) Failing after 35s
Locations and verification
2026-06-04 17:05:42 -05:00

47 lines
958 B
PHP

<?php
/**
* @package ogre-captcha
* @author cleverogre
* @copyright 2026 CleverOgre
* @license GLP-3.0-or-later
* @version 0.0.0
* @since 0.0.0
*/
namespace Ogre\Captcha\Location;
use Override;
use Ogre\Captcha\Location;
use Ogre\Captcha\Settings;
use WP_Error;
use WP_User;
defined('ABSPATH') || exit;
final class LostPasswordForm extends Location {
protected function __construct() {
parent::__construct(Settings::LOCATION_LOST_PASSWORD_FORM);
}
#[Override]
public function enabled(): bool
{
return is_user_logged_in() ? false : parent::enabled();
}
#[Override]
public function activate(): void
{
add_action('lostpassword_form', [$this, 'render']);
add_action('lostpassword_post', [$this, 'process_form']);
}
public function process_form(WP_Error $errors, WP_User|bool $user_data):void {
$this->process($errors);
}
}
LostPasswordForm::instance();