sections, $parent->args, $parent->extra_tabs);
$this->field = $field;
$this->value = $value;
}//function
/**
* Field Render Function.
*
* Takes the vars and outputs the HTML for the field in the settings
*
* @since NHP_Options 1.0
*/
function render(){
$class = (isset($this->field['class']))?$this->field['class']:'regular-text';
echo '';
//if($this->value != ''){
echo '';
//}
if($this->value == ''){$remove = ' style="display:none;"';$upload = '';}else{$remove = '';$upload = ' style="display:none;"';}
echo ' '.__('Browse', 'nhp-opts').'';
echo ' '.__('Remove Upload', 'nhp-opts').'';
echo (isset($this->field['desc']) && !empty($this->field['desc']))?'
'.$this->field['desc'].'':'';
}//function
/**
* Enqueue Function.
*
* If this field requires any scripts, or css define this function and register/enqueue the scripts/css
*
* @since NHP_Options 1.0
*/
function enqueue(){
wp_enqueue_script(
'nhp-opts-field-upload-js',
NHP_OPTIONS_URL.'fields/upload/field_upload.js',
array('jquery', 'thickbox', 'media-upload'),
time(),
true
);
wp_enqueue_style('thickbox');// thanks to https://github.com/rzepak
wp_localize_script('nhp-opts-field-upload-js', 'nhp_upload', array('url' => $this->url.'fields/upload/blank.png'));
}//function
}//class
?>