"upload_image", "std" => "1", "options" => array( "on", "off") ), ); add_action('admin_menu', 'avum_settings_menu'); function avum_settings_menu(){ add_menu_page('Avum Theme Settings', 'Avum Settings', 'administrator', __FILE__, 'avum_settings_create'); add_action( 'admin_init', 'avum_register_settings' ); } function avum_register_settings() { //register our settings register_setting( 'av-setting', 'avum_options', 'avum_options_sanitizer' ); //OPTIONS LIST - these are within the avum_options group //------------------------------------------------------- //avum_options['avum_comments'] -- 2 option radio button group - universally disable comments //avum_options['avum_feature_home'] -- checkbox - display feature rotator on homepage //avum_options['avum_feature_posts'] -- checkbox - display feature rotator on post pages //avum_options['avum_feature_pages'] -- checkbox - display feature rotator on post pages //avum_options['avum_feature_text'] -- textinput - text to be displayed as title of feature area //avum_options['avum_header_home'] -- checkbox - display header image on homepage //avum_options['avum_header_posts'] -- checkbox - display header image on post pages //avum_options['avum_header_pages'] -- checkbox - display header image on pages //**avum_options['avum_mobile_enabled'] -- 2 option radio button group - enable/disable mobile theme //avum_options['avum_custom_font_menu'] -- dropdown - choose font for menu text //avum_options['avum_custom_font_header'] -- dropdown - choose font for headers //avum_options['avum_custom_font_body'] -- dropdown - choose main body font //avum_options['avum_menu_font_size'] -- textinput - choose font size for menu font //avum_options['avum_header_font_size'] -- textinput - choose font size for header fonts (auto decremented) //avum_options['avum_body_font_size'] -- textinput - choose font size for body font //avum_options['avum_main_color'] -- textinput - hex value for main color //avum_options['avum_secondary_color'] -- textinput - hex value for secondary color //avum_options['avum_text_color'] -- textinput - hex value for text color //avum_options['avum_selected_item_color'] -- textinput - hexvalue for current menu item color } function avum_options_sanitizer($avum_options){ //this is the text that shows up as the tile for the feature scroller/banner rotator. The only //thing we'll do here is take out dangerous charachters $avum_options['avum_feature_text'] = wp_filter_nohtml_kses($avum_options['avum_feature_text']); //the only thing we'll do here, besides making it a integer, is truncating it to 3 digits. $avum_options['avum_menu_font_size'] = avum_filter_textsize($avum_options['avum_menu_font_size']); $avum_options['avum_header_font_size'] = avum_filter_textsize($avum_options['avum_header_font_size']); $avum_options['avum_body_font_size'] = avum_filter_textsize($avum_options['avum_body_font_size']); //making sure it's a valid hex code $avum_options['avum_main_color'] = avum_filter_hex($avum_options['avum_main_color']); $avum_options['avum_secondary_color'] = avum_filter_hex($avum_options['avum_secondary_color']); $avum_options['avum_text_color'] = avum_filter_hex($avum_options['avum_text_color']); $avum_options['avum_selected_item_color'] = avum_filter_hex($avum_options['avum_selected_item_color']); //checking radio buttons. They only can only receive 'on' or 'off' as valid values $avum_options['avum_comments'] = avum_filter_button_input($avum_options['avum_comments']); $avum_options['avum_mobile_enabled'] = avum_filter_button_input($avum_options['avum_mobile_enabled']); //checking checkboxes. They can only have the values 'on' or '' $avum_options['avum_feature_home'] = avum_filter_checkbox_input($avum_options['avum_feature_home']); $avum_options['avum_feature_posts'] = avum_filter_checkbox_input($avum_options['avum_feature_posts']); $avum_options['avum_feature_pages'] = avum_filter_checkbox_input($avum_options['avum_feature_pages']); $avum_options['avum_header_home'] = avum_filter_checkbox_input($avum_options['avum_header_home']); $avum_options['avum_header_posts'] = avum_filter_checkbox_input($avum_options['avum_header_posts']); $avum_options['avum_header_pages'] = avum_filter_checkbox_input($avum_options['avum_header_pages']); //handling font select boxes (drop downs) $avum_options['avum_custom_font_menu'] = avum_filter_font_check($avum_options['avum_custom_font_menu']); $avum_options['avum_custom_font_header'] = avum_filter_font_check($avum_options['avum_custom_font_header']); $avum_options['avum_custom_font_body'] = avum_filter_font_check($avum_options['avum_custom_font_body']); return $avum_options; } //Input validation functions-------------------------------------- function avum_filter_font_check($input){ if($input == "Nobile" || $input == "Vollkorn" || $input == "Philosopher" || $input == "Nobile" || $input == "Josefin+Sans+Std+Light"){ return $input; }else{ $input = "default"; return $input; } } function avum_filter_checkbox_input($input){ if($input != ""){ $input="on"; } return $input; } function avum_filter_button_input($input){ if($input != "off"){ $input="on"; } return $input; } function avum_filter_textsize($input){ $pix_regex = '/[0-9]{1,2}\.?[0-9]/i'; preg_match($pix_regex, $input, $matches); $input = $matches[0]; return $input; } function avum_filter_hex($input){ $input = wp_filter_nohtml_kses($input); //in case the user forgot to include the hash character we'll add it if($input[0] == "#"){ //do nothing if it already has the hash character }else{ $input = "#".$input; } $hex_regex = '/^#[a-f0-9]{3,6}/i'; preg_match($hex_regex, $input, $matches); $input = $matches[0]; return $input; } //styling the options and inserting the specific forms function avum_settings_create() { ?>

Avum Settings


Main theme Settings

Enable or Disable comments universally
Choose wether you want comments to be displayed. This universally disable comments but it will not enable comments on posts/pages which individually had comments disabled
/>Disable comments
/>Enable comments
Display Feature scroller
Choose which pages you want the 'featured' scoller to be shown on
/>Display Feature area on Home page
/>Display Feature area on Post pages
/>Display Feature area on Pages
Heading text for feature area
Choose what text you want to display above the 'feature' area (ie. "Featured" , "New Posts", etc.)
Display header image
Choose which pages you want the header image to be shown on
/>Display header image on Home page
/>Display header image Post pages
/>Display header image on Pages
Logo Image
Choose a new image to be displayed in the Logo area. When your image is finished uploading you must press the "Insert into post" button, then the "Save changes" button at the bottom of the page.
To return to the default image, simply clear the text in the textbox and save the settings.
" />

Fonts

All fonts can be previewed at the Google Font Directory
Choose the menu font
- Font Size: px
Choose the header font (ie H1 & H2 tags)
- Font Size: px
Choose the body font
- Font Size: px

Mobile Settings

Enable or Disable mobile theme
Choose whether you want the mobile site to be displayed to supported handheld devices (ie. Smart phones)
/>Enable Mobile theme
/>Disable Mobile theme

Color Adjustments

Enter colors for the elements below
Colors must be entered in hex format (ie. '#333333').
If you want to return to the default options, simply leave all the fields blank (or erase the text in them) and click the "Save changes" button
- Primary Color (Menu text, menu border, body border, H1, H2, etc.)
- Secondary color (Sidebar borders, comment borders)
- Main text color (Main body text, sidebar text -excluding headings)
- Currently selected menu item


If you like the theme, perhaps you would consider a donation.