Locations and verification
Validate Build / validate-build (push) Failing after 35s

This commit is contained in:
Cooper Dalrymple
2026-06-04 17:05:42 -05:00
parent 471e5dd053
commit e8b8fc1871
11 changed files with 538 additions and 13 deletions
+47
View File
@@ -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();