- 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>
34 lines
988 B
PHP
Executable File
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
|
|
}
|
|
|
|
}
|