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
+49
View File
@@ -0,0 +1,49 @@
<?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_Post;
defined('ABSPATH') || exit;
final class PostPasswordForm extends Location {
protected function __construct() {
parent::__construct(Settings::LOCATION_POST_PASSWORD_FORM);
}
#[Override]
public function activate(): void
{
add_filter('the_password_form', [$this, 'render_form']);
add_action('login_form_postpass', [$this, 'process_form']);
}
public function render_form(string $output, WP_Post $post, string $invalid_password):string {
ob_start();
$this->render();
$output .= ob_get_clean();
return $output;
}
public function process_form():void {
$errors = new WP_Error();
$this->process($errors);
$this->print_errors($errors);
}
}
PostPasswordForm::instance();