'text', 'id' => '', 'wrapper_class' => '', 'input_class' => '', 'label_class' => '', 'label' => '', 'name' => '', 'value' => '', 'placeholder' => '', 'description' => '', 'field_description' => '', 'options' => [], 'has_optgroups' => false, 'attributes' => [], 'risk' => '', 'breaks' => '', ]; $args = wp_parse_args( $args, $defaults ); $this->type = $args['type']; $this->id = $args['id']; $this->wrapper_class = $args['wrapper_class']; $this->input_class = $args['input_class']; $this->label = $args['label']; $this->label_class = $args['label_class']; $this->name = $args['name']; $this->description = $args['description']; $this->field_description = $args['field_description']; $this->value = $args['value']; $this->placeholder = $args['placeholder']; $this->options = $args['options']; $this->has_optgroups = $args['has_optgroups']; $this->attributes = $args['attributes']; $this->risk = $args['risk']; $this->breaks = $args['breaks']; $this->allowed_html = [ 'a' => [ 'id' => [], 'class' => [], 'href' => [ 'javascript:void(0);' => [], ], 'title' => [], 'target' => [], 'rel' => [], ], 'span' => [ 'class' => [], ], 'p' => [], 'br' => [], 'em' => [], 'strong' => [], 'small' => [], 'ul' => [], 'ol' => [], 'li' => [], ]; } /** * Renders an HTML form field based on the specified type and attributes. * This method dynamically generates the appropriate form field (e.g., switch, textarea, number, text) * including its label, input elements, and additional descriptive text if provided. * @return void Outputs the generated HTML form field directly. */ public function render(): void { $attr = $this->build_attributes(); ?>
field_description, $this->allowed_html ); ?>
render_risk(); break; } case 'textarea': { ?> field_description ) ) { ?>field_description, $this->allowed_html ); ?>
/> field_description ) ) { ?>field_description, $this->allowed_html ); ?>
/> field_description ) ) { ?>field_description, $this->allowed_html ); ?>
/> field_description ) ) { ?>field_description, $this->allowed_html ); ?>
/> field_description ) ) { ?>field_description, $this->allowed_html ); ?>
/> field_description ) ) { ?>field_description, $this->allowed_html ); ?>
/> field_description ) ) { ?>field_description, $this->allowed_html ); ?>
field_description ) ) { ?>field_description, $this->allowed_html ); ?>
field_description ) ) { ?>field_description, $this->allowed_html ); ?>
field_description, $this->allowed_html ); ?>
breaks ) ); ?>