Locations and verification
Validate Build / validate-build (push) Failing after 35s
Validate Build / validate-build (push) Failing after 35s
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
<?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;
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
final class LoginForm extends Location {
|
||||
|
||||
protected function __construct() {
|
||||
parent::__construct(Settings::LOCATION_LOGIN_FORM);
|
||||
}
|
||||
|
||||
#[Override]
|
||||
public function enabled(): bool
|
||||
{
|
||||
return is_user_logged_in() ? false : parent::enabled();
|
||||
}
|
||||
|
||||
#[Override]
|
||||
public function activate(): void
|
||||
{
|
||||
add_filter('login_form_middle', [$this, 'render_form'], 10, 2);
|
||||
// NOTE: Requires login page processing
|
||||
}
|
||||
|
||||
public function render_form(string $content, array $args):string {
|
||||
ob_start();
|
||||
$this->render();
|
||||
$content .= ob_get_clean();
|
||||
return $content;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
LoginForm::instance();
|
||||
Reference in New Issue
Block a user