Files
ogre-captcha/inc/location/class-lost-password-form.php
T
2026-07-15 10:21:15 -05:00

47 lines
981 B
PHP

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