Files
roi-theme/wp-content/plugins/wp-marketing-automations/rules/inputs/term-select.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

40 lines
948 B
PHP
Executable File

<?php
class bwfan_Input_Term_Select extends bwfan_Input_Text {
public function __construct() {
// vars
$this->type = 'Term_Select';
$this->defaults = array(
'multiple' => 0,
'allow_null' => 0,
'choices' => array(),
'default_value' => '',
'class' => '',
);
}
public function render( $field, $value = null ) {
$field = array_merge( $this->defaults, $field );
if ( ! isset( $field['id'] ) ) {
$field['id'] = sanitize_title( $field['id'] );
}
$args = array(
'name' => $field['name'],
'id' => $field['id'],
'show_option_none' => __( 'Select category', 'wp-marketing-automations' ),
'show_count' => 0,
'orderby' => 'name',
'echo' => 0,
'taxonomy' => 'product_cat',
'selected' => absint( $value ),
);
echo wp_dropdown_categories( $args ); //phpcs:ignore WordPress.Security.EscapeOutput
}
}