parent = $parent; $this->option_name = $field['option_name']; $this->option_id = parent::beautifyid($field['option_name']); $this->value = $value; $this->field = wp_parse_args( $field, array( 'id' => '', 'title' => '', 'desc' => '', 'default' => null, 'readonly' => false, 'style' => 1, 'options' => null, ) ); // If value does not set, use the default /* @todo if( is_null($this->value) ) { $this->value = $this->field['default']; } */ parent::__construct($this->field); } /** * Render field * * Create the HTML interface for your field * * @param $field - an array holding all the field's data * * @since 1.0.0 * @return void */ public function render_field() { // multicheck if( isset($this->field['options']) && $this->field['options'] != null) { $values = (array) $this->value; ?> field['options'] as $key => $label) { $enabled = null; if( in_array($key, $values) ) { $enabled = 1; } if( isset($this->field['style']) && $this->field['style'] == 2 ) { ?> option_name}[]"; ?>" id="option_id); ?>" value="" >
' . $this->field['desc'] . '

'; } else { ?> value, true ); ?> > field['desc']; ?>