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' => '',
'content' => '',
'desc' => '',
'default' => ''
) );
// If value does not set, use the default
if( is_null($this->value) ) {
$this->value = $this->field['default'];
}
if (isset($this->field['callback'])) {
add_filter('dyanmic_field_'.$this->option_id,$this->field['callback']);
}
//parent::__construct($field);
}
/**
* Render field
*
* Create the HTML interface for your field
*
* @param $field - an array holding all the field's data
*
* @since 1.0
* @return void
*/
public function render_field() {
$html = do_shortcode(apply_filters('dyanmic_field_'.$this->option_id,$this->field['content']));
echo $html;
}
}
endif;
add_filter('eof_fieldTypes', function ($field_types) {
if (is_array($field_types)) {
$field_types[] = 'EOF_field_dynamic';
}
return $field_types;
});