1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
<?php
class CMB2_Type_Select_Timezone extends CMB2_Type_Select {
public function render() {
$this->field->args['default'] = $this->field->get_default()
? $this->field->get_default()
: CMB2_Utils::timezone_string();
$this->args = wp_parse_args( $this->args, array(
'class' => 'cmb2_select cmb2-select-timezone',
'options' => wp_timezone_choice( $this->field->escaped_value() ),
'desc' => $this->_desc(),
) );
return parent::render();
}
}