name = 'switch'; // do not delete! parent::__construct(); } function render_field($args) { $field_value = $this->get_value($args); $choices_on = array(); $choices_off = array(); if (isset($args['field']['choices_on'])) { $choices_on = $args['field']['choices_on']; } if (isset($args['field']['choices_off'])) { $choices_off = $args['field']['choices_off']; } if (empty($choices_on) || empty($choices_off) ) { echo 'Configuration error'; return; } // nspre($args['field']); reset($choices_on); $first_key = key($choices_on); echo ''; } } endif;