Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
optometrists
/
cache
/
cache
/
cache
/
cache
/
cache
/
.wp-cli
/
wp-content
/
plugins
/
wp-data-access
/
WPDataAccess
/
Simple_Form
:
WPDA_Simple_Form_Item_Enum_Radio.php
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php namespace WPDataAccess\Simple_Form; class WPDA_Simple_Form_Item_Enum_Radio extends WPDA_Simple_Form_Item_Enum { /** * Overwrite method show_item: create radio group from enum */ protected function show_item() { // Enum column: show values in radio group. $index = 0; foreach ( $this->item_enum as $value ) { $text = ! isset( $this->item_enum_text[ $index ] ) ? $value : $this->item_enum_text[ $index ]; if ( null === $this->item_value ) { $checked = $value === $this->item_default_value ? 'checked' : ''; } else { $checked = $value === $this->item_value ? 'checked' : ''; } ?> <label class="wpda_simple_radio"> <input type="radio" name="<?php echo esc_attr( $this->item_name ); ?>" value="<?php echo esc_attr( $value ); ?>" <?php echo esc_attr( $checked ); ?> > <?php echo esc_attr( $text ); ?> </label> <?php $index++; } } }