Select::field_markup()
Description #
Field markup.
Source #
File: lib/form/class-select.php
public function field_markup() { parent::field_markup(); $this->add_html( '<select' . $this->common_attr() . $this->custom_attr() . '>' ); $this->add_html( '<option value="">' . __( 'Select an option', 'anspress-question-answer' ) . '</option>' ); foreach ( (array) $this->get_options() as $val => $label ) { $selected = selected( $this->value(), $val, false ); $this->add_html( '<option value="' . esc_attr( $val ) . '" ' . $selected . '>' . esc_html( $label ) . '</option>' ); } $this->add_html( '</select>' ); /** This action is documented in lib/form/class-input.php */ do_action_ref_array( 'ap_after_field_markup', array( &$this ) ); }
Expand full source code Collapse full source code View on GitHub: lib/form/class-select.php:87
Add your comment