diff --git a/includes/Component/Component.php b/includes/Component/Component.php index 525d99e7..d47e2f37 100644 --- a/includes/Component/Component.php +++ b/includes/Component/Component.php @@ -13,28 +13,28 @@ abstract class Component { const ALLOWED_HTML = array( 'form' => array( - 'action' => array(), - 'method' => array(), + 'action' => true, + 'method' => true, ), 'label' => array( - 'for' => array(), + 'for' => true, ), 'option' => array( - 'value' => array(), - 'selected' => array(), + 'value' => true, + 'selected' => true, ), 'select' => array( - 'id' => array(), - 'name' => array(), + 'id' => true, + 'name' => true, ), 'input' => array( - 'type' => array(), - 'class' => array(), - 'id' => array(), - 'name' => array(), - 'value' => array(), - 'size' => array(), - 'readonly' => array(), + 'type' => true, + 'class' => true, + 'id' => true, + 'name' => true, + 'value' => true, + 'size' => true, + 'readonly' => true, ), ); @@ -45,6 +45,8 @@ abstract public function render(): string; /** * Adds our input elements to the allowed HTML elements of a post + * + * @return array> */ public static function get_allowed_html(): array { $my_allowed = wp_kses_allowed_html( 'post' ); diff --git a/includes/Component/Input/Text.php b/includes/Component/Input/Text.php index 16573bca..e8d422ee 100644 --- a/includes/Component/Input/Text.php +++ b/includes/Component/Input/Text.php @@ -49,7 +49,7 @@ public function render(): string { '', esc_attr( $this->key ), esc_attr( $this->value ), - esc_attr( $this->size ), + $this->size, $this->readonly // phpcs:ignore WordPress.Security.EscapeOutput ); }