Files
roi-theme/wp-content/plugins/wp-marketing-automations/rules/inputs/text.php
root a22573bf0b Commit inicial - WordPress Análisis de Precios Unitarios
- WordPress core y plugins
- Tema Twenty Twenty-Four configurado
- Plugin allow-unfiltered-html.php simplificado
- .gitignore configurado para excluir wp-config.php y uploads

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-03 21:04:30 -06:00

34 lines
988 B
PHP
Executable File

<?php
#[AllowDynamicProperties]
class bwfan_Input_Text {
public function __construct() {
// vars
$this->type = 'Text';
$this->defaults = array(
'default_value' => '',
'class' => '',
'placeholder' => '',
'disabled' => false,
);
}
public function render( $field, $value = null ) {
$field = array_merge( $this->defaults, $field );
if ( ! isset( $field['id'] ) ) {
$field['id'] = sanitize_title( $field['id'] );
}
$disabled = '';
if ( true === $field['disabled'] ) {
$disabled = 'disabled';
}
/** Don't add any escaping method on name field as it will break the dynamic backbone string */
echo '<input ' . esc_attr( $disabled ) . ' name="' . $field['name'] . '" type="text" id="' . esc_attr( $field['id'] ) . '" class="' . esc_html( $field['class'] ) . '" placeholder="' . esc_html( $field['placeholder'] ) . '" value="' . $value . '" />'; //phpcs:ignore WordPress.Security.EscapeOutput, WordPress.Security.EscapeOutput
}
}