__('A Section added by hook', 'nhp-opts'), 'desc' => __('

This is a section created by adding a filter to the sections array, great to allow child themes, to add/remove sections from the options.

', 'nhp-opts'), 'icon' => trailingslashit(get_template_directory_uri()).'options/img/glyphicons/glyphicons_062_attach.png', 'fields' => array() ); return $sections; } function change_framework_args($args){ return $args; } function setup_framework_options(){ $args = array(); $args['dev_mode'] = true; $args['intro_text'] = __('

', 'nhp-opts'); $args['opt_name'] = 'eep'; $args['menu_title'] = __('Theme Options', 'nhp-opts'); $args['page_title'] = __('Theme Options', 'nhp-opts'); $args['page_slug'] = 'nhp_theme_options'; $args['page_position'] = 27; $sections[] = array( 'title' => __('Header ', 'nhp-opts'), 'desc' => __('

', 'nhp-opts'), 'fields' => array( array( 'id' => 'logo', 'type' => 'upload', 'title' => __('Logo Upload', 'nhp-opts'), 'desc' => __('Upload Logo For Header', 'nhp-opts'), ), array( 'id' => 'add', 'type' => 'editor', 'title' => __('Advertisement Banner ', 'nhp-opts'), 'desc' => __('Enter Advertisement Banner', 'nhp-opts'), ), array( 'id' => 'favicon', 'type' => 'upload', 'title' => __('Favicon Upload', 'nhp-opts'), 'desc' => __('Click to upload favicon', 'nhp-opts'), ), ) ); $sections[] = array( 'title' => __('Footer ', 'nhp-opts'), 'desc' => __('

', 'nhp-opts'), 'fields' => array( array( 'id' => 'footer_logo', 'type' => 'upload', 'title' => __('Footer Upload', 'nhp-opts'), 'desc' => __('Upload Logo For Footer', 'nhp-opts'), ), array( 'id' => 'copyright', 'type' => 'editor', 'title' => __('Copyright Text', 'nhp-opts'), 'desc' => __('Enter Copyright Text', 'nhp-opts'), ), ) ); $tabs = array(); if (function_exists('wp_get_theme')){ $theme_data = wp_get_theme(); $theme_uri = $theme_data->get('ThemeURI'); $description = $theme_data->get('Description'); $author = $theme_data->get('Author'); $version = $theme_data->get('Version'); $tags = $theme_data->get('Tags'); }else{ $theme_data = wp_get_theme(trailingslashit(get_stylesheet_directory()).'style.css'); $theme_uri = $theme_data['URI']; $description = $theme_data['Description']; $author = $theme_data['Author']; $version = $theme_data['Version']; $tags = $theme_data['Tags']; } $theme_info = '
'; $theme_info .= '

'.__('Theme URL: ', 'nhp-opts').''.$theme_uri.'

'; $theme_info .= '

'.__('Author: ', 'nhp-opts').$author.'

'; $theme_info .= '

'.__('Version: ', 'nhp-opts').$version.'

'; $theme_info .= '

'.$description.'

'; $theme_info .= '

'.__('Tags: ', 'nhp-opts').implode(', ', $tags).'

'; $theme_info .= '
'; $tabs['theme_info'] = array( 'icon' => NHP_OPTIONS_URL.'img/glyphicons/glyphicons_195_circle_info.png', 'title' => __('Theme Information', 'nhp-opts'), 'content' => $theme_info ); if(file_exists(trailingslashit(get_stylesheet_directory()).'README.html')){ $tabs['theme_docs'] = array( 'icon' => NHP_OPTIONS_URL.'img/glyphicons/glyphicons_071_book.png', 'title' => __('Documentation', 'nhp-opts'), 'content' => nl2br(WP_Filesystem(trailingslashit(get_stylesheet_directory()).'README.html')) ); }//if global $NHP_Options; $NHP_Options = new NHP_Options($sections, $args, $tabs); } add_action('init', 'setup_framework_options', 0); function my_custom_field($field, $value){ print_r($field); print_r($value); } function validate_callback_function($field, $value, $existing_value){ $error = false; $value = 'just testing'; $return['value'] = $value; if($error == true){ $return['error'] = $field; } return $return; } ?>