sections, $parent->args, $parent->extra_tabs); $this->field = $field; $this->value = $value; $this->field['fonts'] = array(); $fonts = get_transient('nhp-opts-google-webfonts'); if(!is_array(json_decode($fonts))){ $fonts = wp_remote_retrieve_body(wp_remote_get('https://www.googleapis.com/webfonts/v1/webfonts?key='.$this->args['google_api_key'])); set_transient('nhp-opts-google-webfonts', $fonts, 60 * 60 * 24); } $this->field['fonts'] = json_decode($fonts); }//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']))?'class="'.$this->field['class'].'" ':''; echo '
'.__('The fonts provided below are free to use custom fonts from the Google Web Fonts directory.
Please browse the directory to preview a font, then select your choice below.', 'nhp-opts').'