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

41 lines
926 B
PHP
Executable File

<?php
class bwfan_Input_Page_Select extends bwfan_Input_Text {
public function __construct() {
// vars
$this->type = 'Page_Select';
$this->defaults = array(
'multiple' => 0,
'allow_null' => 0,
'choices' => array(),
'default_value' => '',
'class' => 'ajax_chosen_select_products',
);
}
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'],
'sort_column' => 'menu_order',
'sort_order' => 'ASC',
'show_option_none' => ' ',
'class' => '',
'echo' => false,
'selected' => absint( $value ),
);
echo wp_dropdown_pages( $args ); //phpcs:ignore WordPress.Security.EscapeOutput
}
}