Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Syncing up with version 0.8 of Options Framework plugin.

  • Loading branch information...
commit c7fdf26b22c1f728543a0543071cca5646b80f40 1 parent cb68442
@devinsays authored
View
26 admin/css/admin-style.css
@@ -9,18 +9,18 @@
margin: 10px 0;
width: 785px;
position:relative;
- z-index: 0
+ z-index: 0;
}
#of_container #header {
height: 60px;
background:#dfdfdf url("../../../../wp-admin/images/gray-grad.png") repeat-x left top;
border: 1px solid #ccc;
- border-top-left-radius: 6px;
- -moz-border-radius-topleft: 6px;
- -webkit-border-top-left-radius: 6px;
- -webkit-border-top-right-radius: 6px;
- border-top-right-radius: 6px;
- -moz-border-radius-topright: 6px;
+ border-top-left-radius: 3px;
+ -moz-border-radius-topleft: 3px;
+ -webkit-border-top-left-radius: 3px;
+ -webkit-border-top-right-radius: 3px;
+ border-top-right-radius: 3px;
+ -moz-border-radius-topright: 3px;
}
#of_container #header .logo {
float: left;
@@ -307,10 +307,10 @@
padding: 10px 20px 0px 20px;
height: 35px;
text-align: right;
- -moz-border-radius-bottomright: 6px;
- -moz-border-radius-bottomleft: 6px;
- -webkit-border-bottom-right-radius: 6px;
- -webkit-border-bottom-left-radius: 6px;
- border-bottom-right-radius: 6px;
- border-bottom-left-radius: 6px;
+ -moz-border-radius-bottomright: 3px;
+ -moz-border-radius-bottomleft: 3px;
+ -webkit-border-bottom-right-radius: 3px;
+ -webkit-border-bottom-left-radius: 3px;
+ border-bottom-right-radius: 3px;
+ border-bottom-left-radius: 3px;
}
View
39 admin/js/options-custom.js
@@ -31,7 +31,15 @@ jQuery(document).ready(function($) {
// Switches option sections
$('.group').hide();
- $('.group:first').fadeIn();
+ var activetab = '';
+ if (typeof(localStorage) != 'undefined' ) {
+ activetab = localStorage.getItem("activetab");
+ }
+ if (activetab != '' && $(activetab).length ) {
+ $(activetab).fadeIn();
+ } else {
+ $('.group:first').fadeIn();
+ }
$('.group .collapsed').each(function(){
$(this).find('input:checked').parent().parent().parent().nextAll().each(
function(){
@@ -42,6 +50,24 @@ jQuery(document).ready(function($) {
$(this).filter('.hidden').removeClass('hidden');
});
});
+
+ if (activetab != '' && $(activetab + '-tab').length ) {
+ $(activetab + '-tab').parent('li').addClass('current');
+ }
+ else {
+ $('#of-nav li:first').addClass('current');
+ }
+ $('#of-nav li a').click(function(evt) {
+ $('#of-nav li').removeClass('current');
+ $(this).parent().addClass('current');
+ var clicked_group = $(this).attr('href');
+ if (typeof(localStorage) != 'undefined' ) {
+ localStorage.setItem("activetab", $(this).attr('href'));
+ }
+ $('.group').hide();
+ $(clicked_group).fadeIn();
+ evt.preventDefault();
+ });
$('.group .collapsed input:checkbox').click(unhideHidden);
@@ -71,14 +97,5 @@ jQuery(document).ready(function($) {
$('.of-radio-img-label').hide();
$('.of-radio-img-img').show();
$('.of-radio-img-radio').hide();
-
- $('#of-nav li:first').addClass('current');
- $('#of-nav li a').click(function(evt) {
- $('#of-nav li').removeClass('current');
- $(this).parent().addClass('current');
- var clicked_group = $(this).attr('href');
- $('.group').hide();
- $(clicked_group).fadeIn();
- evt.preventDefault();
- });
+
});
View
290 admin/options-framework.php
@@ -3,7 +3,7 @@
Plugin Name: Options Framework
Plugin URI: http://www.wptheming.com
Description: A framework for building theme options.
-Version: 0.6
+Version: 0.8
Author: Devin Price
Author URI: http://www.wptheming.com
License: GPLv2
@@ -27,7 +27,7 @@
/* Basic plugin definitions */
-define('OPTIONS_FRAMEWORK_VERSION', '0.6');
+define('OPTIONS_FRAMEWORK_VERSION', '0.8');
/* Make sure we don't expose any info if called directly */
@@ -41,19 +41,44 @@
add_action('init', 'optionsframework_rolescheck' );
function optionsframework_rolescheck () {
- if ( current_user_can('edit_theme_options') ) {
+ if ( current_user_can( 'edit_theme_options' ) ) {
// If the user can edit theme options, let the fun begin!
- add_action('admin_menu', 'optionsframework_add_page');
- add_action('admin_init', 'optionsframework_init' );
+ add_action( 'admin_menu', 'optionsframework_add_page');
+ add_action( 'admin_init', 'optionsframework_init' );
add_action( 'admin_init', 'optionsframework_mlu_init' );
}
}
+/* Register plugin activation hooks */
+
+register_activation_hook(__FILE__,'optionsframework_activation_hook');
+
+function optionsframework_activation_hook() {
+ register_uninstall_hook( __FILE__, 'optionsframework_delete_options' );
+}
+
+/* When uninstalled, deletes options */
+
+register_uninstall_hook( __FILE__, 'optionsframework_delete_options' );
+
+function optionsframework_delete_options() {
+
+ $optionsframework_settings = get_option('optionsframework');
+
+ // Each theme saves its data in a seperate option, which all gets deleted
+ $knownoptions = $optionsframework_settings['knownoptions'];
+ if ($knownoptions) {
+ foreach ($knownoptions as $key) {
+ delete_option($key);
+ }
+ }
+ delete_option('optionsframework');
+}
+
/*
* Creates the settings in the database by looping through the array
* we supplied in options.php. This is a neat way to do it since
- * we won't have to save settings for headers, descriptions, or arguments-
- * and it makes it a little easier to change and set up in my opinion.
+ * we won't have to save settings for headers, descriptions, or arguments.
*
* Read more about the Settings API in the WordPress codex:
* http://codex.wordpress.org/Settings_API
@@ -75,19 +100,26 @@ function optionsframework_init() {
require_once dirname( __FILE__ ) . '/options.php';
}
- $optionsframework_settings = get_option('optionsframework');
+ $optionsframework_settings = get_option('optionsframework' );
// Updates the unique option id in the database if it has changed
optionsframework_option_name();
// Gets the unique id, returning a default if it isn't defined
- $option_name = $optionsframework_settings['id'];
+ if ( isset($optionsframework_settings['id']) ) {
+ $option_name = $optionsframework_settings['id'];
+ }
+ else {
+ $option_name = 'optionsframework';
+ }
- // Set the option defaults in case they have changed
- optionsframework_setdefaults();
+ // If the option has no saved data, load the defaults
+ if ( ! get_option($option_name) ) {
+ optionsframework_setdefaults();
+ }
// Registers the settings fields and callback
- register_setting('optionsframework', $option_name, 'optionsframework_validate' );
+ register_setting( 'optionsframework', $option_name, 'optionsframework_validate' );
}
/*
@@ -101,7 +133,7 @@ function optionsframework_init() {
*/
function optionsframework_setdefaults() {
-
+
$optionsframework_settings = get_option('optionsframework');
// Gets the unique option id
@@ -114,7 +146,7 @@ function optionsframework_setdefaults() {
* its associated data. No need to clutter the database.
*
*/
-
+
if ( isset($optionsframework_settings['knownoptions']) ) {
$knownoptions = $optionsframework_settings['knownoptions'];
if ( !in_array($option_name, $knownoptions) ) {
@@ -130,32 +162,12 @@ function optionsframework_setdefaults() {
// Gets the default options data from the array in options.php
$options = optionsframework_options();
-
- // If the options haven't been added to the database yet, they are added now
- foreach ($options as $option) {
- if ( ($option['type'] != 'heading') && ($option['type'] != 'info') ) {
- $option_id = preg_replace('/\W/', '', strtolower($option['id']) );
-
- // wp_filter_post_kses for strings
- if (isset($option['std' ]) ) {
- if ( !is_array($option['std' ]) ) {
- $values[$option_id] = wp_filter_post_kses($option['std']);
- } else {
- foreach ($option['std' ] as $key => $value) {
- $optionarray[$key] = wp_filter_post_kses($value);
- }
- $values[$option_id] = $optionarray;
- unset($optionarray);
- }
- } else {
- $value = '';
- }
- }
- }
+ // If the options haven't been added to the database yet, they are added now
+ $values = of_get_default_values();
if ( isset($values) ) {
- add_option($option_name, $values);
+ add_option( $option_name, $values ); // Add option with default settings
}
}
@@ -176,8 +188,8 @@ function optionsframework_add_page() {
/* Loads the CSS */
function optionsframework_load_styles() {
- wp_enqueue_style('admin-style', OPTIONS_FRAMEWORK_DIRECTORY .'css/admin-style.css');
- wp_enqueue_style('color-picker', OPTIONS_FRAMEWORK_DIRECTORY .'css/colorpicker.css');
+ wp_enqueue_style('admin-style', OPTIONS_FRAMEWORK_DIRECTORY.'css/admin-style.css');
+ wp_enqueue_style('color-picker', OPTIONS_FRAMEWORK_DIRECTORY.'css/colorpicker.css');
}
/* Loads the javascript */
@@ -189,8 +201,8 @@ function optionsframework_load_scripts() {
// Enqueued scripts
wp_enqueue_script('jquery-ui-core');
- wp_enqueue_script('color-picker', OPTIONS_FRAMEWORK_DIRECTORY . 'js/colorpicker.js', array('jquery'));
- wp_enqueue_script('options-custom', OPTIONS_FRAMEWORK_DIRECTORY . 'js/options-custom.js', array('jquery'));
+ wp_enqueue_script('color-picker', OPTIONS_FRAMEWORK_DIRECTORY.'js/colorpicker.js', array('jquery'));
+ wp_enqueue_script('options-custom', OPTIONS_FRAMEWORK_DIRECTORY.'js/options-custom.js', array('jquery'));
}
function of_admin_head() {
@@ -260,105 +272,110 @@ function optionsframework_page() {
}
}
-/*
- * Data sanitization!
+/**
+ * Validate Options.
*
* This runs after the submit/reset button has been clicked and
* validates the inputs.
*
+ * @uses $_POST['reset']
+ * @uses $_POST['update']
*/
+function optionsframework_validate( $input ) {
-function optionsframework_validate($input) {
-
- $optionsframework_settings = get_option('optionsframework');
-
- // Gets the unique option id
- $option_name = $optionsframework_settings['id'];
-
- // If the reset button was clicked
- if (!empty($_POST['reset'])) {
- // If options are deleted sucessfully update the error message
- if (delete_option($option_name) ) {
- add_settings_error('options-framework', 'restore_defaults', __('Default options restored.'), 'updated fade');
- }
+ /*
+ * Restore Defaults.
+ *
+ * In the event that the user clicked the "Restore Defaults"
+ * button, the options defined in the theme's options.php
+ * file will be added to the option for the active theme.
+ */
+
+ if ( isset( $_POST['reset'] ) ) {
+ add_settings_error( 'options-framework', 'restore_defaults', __( 'Default options restored.', 'optionsframework' ), 'updated fade' );
+ return of_get_default_values();
}
-
- else
-
- {
-
- if (!empty($_POST['update'])) {
-
- $clean = array();
- // Get the options array we have defined in options.php
+ /*
+ * Udpdate Settings.
+ */
+
+ if ( isset( $_POST['update'] ) ) {
+ $clean = array();
$options = optionsframework_options();
-
- foreach ($options as $option) {
-
- // Verify that the option has an id
- if ( isset ($option['id']) ) {
-
- // Keep all ids lowercase with no spaces
- $id = preg_replace( '/\W/', '', strtolower( $option['id'] ) );
-
- // Set checkbox to false if it wasn't sent in the $_POST
- if ( 'checkbox' == $option['type'] && ! isset( $input[$id] ) ) {
- $input[$id] = "0";
- }
-
- // Set each item in the multicheck to false if it wasn't sent in the $_POST
- if ( 'multicheck' == $option['type'] && ! isset( $input[$id] ) ) {
- foreach ( $option['options'] as $key => $value ) {
- $input[$id][$key] = "0";
- }
- }
-
- // For a value to be submitted to database it must pass through a sanitization filter
- if ( isset ( $input[$id] ) && has_filter('of_sanitize_' . $option['type']) ) {
- $clean[$id] = apply_filters( 'of_sanitize_' . $option['type'], $input[$id], $option );
+ foreach ( $options as $option ) {
+
+ if ( ! isset( $option['id'] ) ) {
+ continue;
+ }
+
+ if ( ! isset( $option['type'] ) ) {
+ continue;
+ }
+
+ $id = preg_replace( '/\W/', '', strtolower( $option['id'] ) );
+
+ // Set checkbox to false if it wasn't sent in the $_POST
+ if ( 'checkbox' == $option['type'] && ! isset( $input[$id] ) ) {
+ $input[$id] = '0';
+ }
+
+ // Set each item in the multicheck to false if it wasn't sent in the $_POST
+ if ( 'multicheck' == $option['type'] && ! isset( $input[$id] ) ) {
+ foreach ( $option['options'] as $key => $value ) {
+ $input[$id][$key] = '0';
}
-
- } // end isset $input
-
- } // end isset $id
-
- } // end foreach
-
- if ( isset($clean) ) {
- add_settings_error('options-framework', 'save_options', __('Options saved.'), 'updated fade');
- return $clean; // Return validated input
+ }
+
+ // For a value to be submitted to database it must pass through a sanitization filter
+ if ( has_filter( 'of_sanitize_' . $option['type'] ) ) {
+ $clean[$id] = apply_filters( 'of_sanitize_' . $option['type'], $input[$id], $option );
+ }
+ }
+
+ add_settings_error( 'options-framework', 'save_options', __( 'Options saved.', 'optionsframework' ), 'updated fade' );
+ return $clean;
}
+
+ /*
+ * Request Not Recognized.
+ */
- } // end $_POST['update']
-
+ return of_get_default_values();
}
-
-/*
- * Helper function to return the theme option value. If no value has been saved, it returns $default.
- * Needed because options are saved as serialized strings.
+/**
+ * Format Configuration Array.
+ *
+ * Get an array of all default values as set in
+ * options.php. The 'id','std' and 'type' keys need
+ * to be defined in the configuration array. In the
+ * event that these keys are not present the option
+ * will not be included in this function's output.
+ *
+ * @return array Rey-keyed options configuration array.
*
+ * @access private
*/
-
-if ( !function_exists( 'of_get_option' ) ) {
-function of_get_option($name, $default = false) {
-
- $optionsframework_settings = get_option('optionsframework');
-
- // Gets the unique option id
- $option_name = $optionsframework_settings['id'];
-
- if ( get_option($option_name) ) {
- $options = get_option($option_name);
- }
-
- if ( !empty($options[$name]) ) {
- return $options[$name];
- } else {
- return $default;
+
+function of_get_default_values() {
+ $output = array();
+ $config = optionsframework_options();
+ foreach ( (array) $config as $option ) {
+ if ( ! isset( $option['id'] ) ) {
+ continue;
+ }
+ if ( ! isset( $option['std'] ) ) {
+ continue;
+ }
+ if ( ! isset( $option['type'] ) ) {
+ continue;
+ }
+ if ( has_filter( 'of_sanitize_' . $option['type'] ) ) {
+ $output[$option['id']] = apply_filters( 'of_sanitize_' . $option['type'], $option['std'], $option );
+ }
}
-}
+ return $output;
}
/**
@@ -377,4 +394,31 @@ function optionsframework_adminbar() {
'title' => __( 'Theme Options' ),
'href' => admin_url( 'themes.php?page=options-framework' )
));
+}
+
+if ( ! function_exists( 'of_get_option' ) ) {
+
+ /**
+ * Get Option.
+ *
+ * Helper function to return the theme option value.
+ * If no value has been saved, it returns $default.
+ * Needed because options are saved as serialized strings.
+ */
+
+ function of_get_option( $name, $default = false ) {
+ $config = get_option( 'optionsframework' );
+
+ if ( ! isset( $config['id'] ) ) {
+ return $default;
+ }
+
+ $options = get_option( $config['id'] );
+
+ if ( isset( $options[$name] ) ) {
+ return $options[$name];
+ }
+
+ return $default;
+ }
}
View
13 admin/options-interface.php
@@ -194,12 +194,9 @@ function optionsframework_fields() {
// Font Weight
$output .= '<select class="of-typography of-typography-style" name="'.$option_name.'['.$value['id'].'][style]" id="'. $value['id'].'_style">';
- $styles = array('normal'=>'Normal',
- 'italic'=>'Italic',
- 'bold'=>'Bold',
- 'bold italic'=>'Bold Italic');
-
- foreach ($styles as $key => $style) {
+ /* Font Style */
+ $styles = of_recognized_font_styles();
+ foreach ( $styles as $key => $style ) {
$output .= '<option value="' . esc_attr( $key ) . '" ' . selected( $typography_stored['style'], $key, false ) . '>'. $style .'</option>';
}
$output .= '</select>';
@@ -276,7 +273,7 @@ function optionsframework_fields() {
$output .= '<h3 class="heading">' . esc_html( $value['name'] ) . '</h3>' . "\n";
}
if ( $value['desc'] ) {
- $output .= '<p>'. wp_kses( $value['desc'], $allowedtags) . '</p>' . "\n";
+ $output .= wpautop( wp_kses( $value['desc'], $allowedtags) ) . "\n";
}
$output .= '<div class="clear"></div></div>' . "\n";
break;
@@ -288,7 +285,7 @@ function optionsframework_fields() {
}
$jquery_click_hook = preg_replace('/\W/', '', strtolower($value['name']) );
$jquery_click_hook = "of-option-" . $jquery_click_hook;
- $menu .= '<li><a title="' . esc_attr( $value['name'] ) . '" href="' . esc_attr( '#'. $jquery_click_hook ) . '">' . esc_html( $value['name'] ) . '</a></li>';
+ $menu .= '<li><a id="'. esc_attr( $jquery_click_hook ) . '-tab" title="' . esc_attr( $value['name'] ) . '" href="' . esc_attr( '#'. $jquery_click_hook ) . '">' . esc_html( $value['name'] ) . '</a></li>';
$output .= '<div class="group" id="' . esc_attr( $jquery_click_hook ) . '"><h2>' . esc_html( $value['name'] ) . '</h2>' . "\n";
break;
}
View
40 admin/options-sanitize.php
@@ -153,6 +153,7 @@ function of_sanitize_typography( $input ) {
function of_sanitize_font_size( $value ) {
$recognized = of_recognized_font_sizes();
+ $value = preg_replace('/px/','', $value);
if ( in_array( (int) $value, $recognized ) ) {
return (int) $value;
}
@@ -187,12 +188,13 @@ function of_sanitize_font_face( $value ) {
*
*/
function of_recognized_background_repeat() {
- return array(
- 'none' => 'No Repeat',
- 'repeat-x' => 'Repeat Horizontally',
- 'repeat-y' => 'Repeat Vertically',
- 'repeat' => 'Repeat All',
+ $default = array(
+ 'no-repeat' => 'No Repeat',
+ 'repeat-x' => 'Repeat Horizontally',
+ 'repeat-y' => 'Repeat Vertically',
+ 'repeat' => 'Repeat All',
);
+ return apply_filters( 'of_recognized_background_repeat', $default );
}
/**
@@ -202,17 +204,18 @@ function of_recognized_background_repeat() {
*
*/
function of_recognized_background_position() {
- return array(
- 'top left' => 'Top Left',
- 'top center' => 'Top Center',
- 'top right' => 'Top Right',
- 'center left' => 'Middle Left',
+ $default = array(
+ 'top left' => 'Top Left',
+ 'top center' => 'Top Center',
+ 'top right' => 'Top Right',
+ 'center left' => 'Middle Left',
'center center' => 'Middle Center',
- 'center right' => 'Middle Right',
- 'bottom left' => 'Bottom Left',
+ 'center right' => 'Middle Right',
+ 'bottom left' => 'Bottom Left',
'bottom center' => 'Bottom Center',
- 'bottom right' => 'Bottom Right'
+ 'bottom right' => 'Bottom Right'
);
+ return apply_filters( 'of_recognized_background_position', $default );
}
/**
@@ -222,10 +225,11 @@ function of_recognized_background_position() {
*
*/
function of_recognized_background_attachment() {
- return array(
+ $default = array(
'scroll' => 'Scroll Normally',
- 'fixed' => 'Fixed in Place'
+ 'fixed' => 'Fixed in Place'
);
+ return apply_filters( 'of_recognized_background_attachment', $default );
}
/**
@@ -272,7 +276,7 @@ function of_recognized_font_sizes() {
*
*/
function of_recognized_font_faces() {
- return array(
+ $default = array(
'arial' => 'Arial',
'verdana' => 'Verdana, Geneva',
'trebuchet' => 'Trebuchet',
@@ -282,6 +286,7 @@ function of_recognized_font_faces() {
'palatino' => 'Palatino',
'helvetica' => 'Helvetica*'
);
+ return apply_filters( 'of_recognized_font_faces', $default );
}
/**
@@ -295,12 +300,13 @@ function of_recognized_font_faces() {
*
*/
function of_recognized_font_styles() {
- return array(
+ $default = array(
'normal' => 'Normal',
'italic' => 'Italic',
'bold' => 'Bold',
'bold italic' => 'Bold Italic'
);
+ return apply_filters( 'of_recognized_font_styles', $default );
}
/**
View
49 changelog.txt
@@ -1,17 +1,46 @@
-Options Theme 0.3
+== Changelog ==
-- Complete rewrite based on the Options Framework plugin
+= 0.8 =
-Options Theme 0.2.1
+* Saves tab states using local storage
+* Minor style updates for WordPress 3.2 release
--Updated js in admin-interface so that ajax upload works in Chrome.
--Updated the admin stylesheet so rounded corners work in webkit.
+= 0.7 =
-Options Theme 0.2
+* Added filtering for recognized arrays (like Font Face)
+* Using isset rather than !empty to return of_get_option
+* Significant updates for setting and restoring defaults
+* Background option outputs no-repeat rather than none
-- Fixed some minor css bugs.
-- Changed layouts to be set through body classes rather than stylesheets.
+= 0.6 =
-Options Theme 0.1
+* Introduces validation filters
+* Better data sanitization and escaping
+* Updates labels in options-interface.php
+* Changes how checkboxes saved in database ("0" or "1")
+* Stores typography, backgrounds and multichecks directly as arrays
+* For full description, see: http://wptheming.com/2011/05/options-framework-0-6/
-Initial Release
+= 0.5 =
+
+* Fixed errors when more than one multicheck options is used
+* Updated optionsframework_setdefaults so defaults actually save on first run
+* Require that all options have lowercase alphanumeric ids
+* Added link to options from the WordPress admin bar
+
+= 0.4 =
+
+* Updated multicheck option to save keys rather than values
+* Unset default array options after each output in optionsframework_setdefaults
+
+= 0.3 =
+
+* White listed options for increased security
+* Fixed errors with checkbox and select boxes
+* Improved the multicheck option and changed format
+
+= 0.2 =
+
+* Uploaded to the WordPress repository
+
+= 0.1 =
View
26 functions.php
@@ -18,4 +18,30 @@
require_once (OPTIONS_FRAMEWORK_URL . 'options-framework.php');
+}
+
+/*
+ * This is an example of how to add custom scripts to the options panel.
+ * This one shows/hides the an option when a checkbox is clicked.
+ */
+
+add_action('optionsframework_custom_scripts', 'optionsframework_custom_scripts');
+
+function optionsframework_custom_scripts() { ?>
+
+<script type="text/javascript">
+jQuery(document).ready(function() {
+
+ jQuery('#example_showhidden').click(function() {
+ jQuery('#section-example_text_hidden').fadeToggle(400);
+ });
+
+ if (jQuery('#example_showhidden:checked').val() !== undefined) {
+ jQuery('#section-example_text_hidden').show();
+ }
+
+});
+</script>
+
+<?php
}
View
102 readme.txt
@@ -1,11 +1,101 @@
-I am in the process of a complete rewrite of this code based on the Options Framework plugin. Download the 0.2.1 tag if you want the latest stable version.
+=== Options Framework ===
+Contributors: Devin Price
+Tags: options, theme options
+Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=X238BDP4QGTV2
+Requires at least: 3.0
+Tested up to: 3.2
+Stable tag: 0.8
+License: GPLv2
---
+== Description ==
-The Options Frameworks was created to help developers build options into their themes. This one was built as an example using a child theme of TwentyTen. To view a video demo of how it works and read the documentation, please visit: http://wptheming.com/options-framework.
+This is the adapted theme version of the Options Framework plugin.
-Version 0.1 of this theme was coded using WooThemes Canvas as a base (http://www.woothemes.com/2010/02/canvas/). The Options Framework is actually a slimmed down version of their version in Canvas, and I'd encourage you to check out and support WooThemes if you find this project helpful.
+The Options Framework Plugin makes it easy to include an options panel in any WordPress theme. It was built so that theme developers can concentrate on making the actual theme rather than spending a ton of time on creating an options panel from scratch. It's free to use in both commercial and personal projects, just like WordPress itself.
-If you want to set up the theme options for your own theme, drag the functions folder from the options-framework into your own theme. Then copy the text inside functions.php and paste that into the functions.php file of your own theme (or just drag it in if you don't have a functions.php file yet in your theme. That's it, basically.
+Please visit [http://wptheming.com/options-framework-plugin](http://wptheming.com/options-framework-plugin) for a full description of how to define and use the theme options.
-If you want to use additional stylesheets or layouts, copy those folders into your theme as well. If you don't, make sure the functions and options associated with them are removed from the theme functions.
+The code is heavily based on the [WooFramework](http://www.woothemes.com/) and their option styles.
+
+== Installation ==
+
+If your theme already has options enabled, they will show up under the apperance menu.
+
+If your theme doesn't have options, you can define them to options.php of your theme and they will instantly show up. For more on how to do this, visit [http://wptheming.com/options-framework-plugin](http://wptheming.com/options-framework-plugin).
+
+== Frequently Asked Questions ==
+
+= How do I build options for my own theme? =
+
+Download the development version from GitHub [https://github.com/devinsays/options-framework-plugin](https://github.com/devinsays/options-framework-plugin) and copy the "options-check" folder into your themes directory.
+
+The "Options Check" theme is a blueprint for how to work with options. It includes an example of every option available in the panel and sample output in the theme.
+
+You can also watch the video screencast I have at [http://wptheming.com/options-framework-plugin](http://wptheming.com/options-framework-plugin).
+
+= What options are available to use? =
+
+* text
+* textarea
+* checkbox
+* select
+* radio
+* upload (an image uploader)
+* images (use images instead of radio buttons)
+* background (a set of options to define a background)
+* multicheck
+* color (a jquery color picker)
+* typography (a set of options to define typography)
+
+== Screenshots ==
+
+1. An example of the "Advanced Options" tag in the "Options Check" theme using this plugin.
+
+== Changelog ==
+
+= 0.8 =
+
+* Saves tab states using local storage
+* Minor style updates for WordPress 3.2 release
+
+= 0.7 =
+
+* Added filtering for recognized arrays (like Font Face)
+* Using isset rather than !empty to return of_get_option
+* Significant updates for setting and restoring defaults
+* Background option outputs no-repeat rather than none
+
+= 0.6 =
+
+* Introduces validation filters
+* Better data sanitization and escaping
+* Updates labels in options-interface.php
+* Changes how checkboxes saved in database ("0" or "1")
+* Stores typography, backgrounds and multichecks directly as arrays
+* For full description, see: http://wptheming.com/2011/05/options-framework-0-6/
+
+= 0.5 =
+
+* Fixed errors when more than one multicheck options is used
+* Updated optionsframework_setdefaults so defaults actually save on first run
+* Require that all options have lowercase alphanumeric ids
+* Added link to options from the WordPress admin bar
+
+= 0.4 =
+
+* Updated multicheck option to save keys rather than values
+* Unset default array options after each output in optionsframework_setdefaults
+
+= 0.3 =
+
+* White listed options for increased security
+* Fixed errors with checkbox and select boxes
+* Improved the multicheck option and changed format
+
+= 0.2 =
+
+* Uploaded to the WordPress repository
+
+= 0.1 =
+
+* Initial release
View
2  style.css
@@ -4,7 +4,7 @@ Theme URI: http://wptheming.com
Description: An example/test theme with a complete theme options panel.
Author: Devin Price
Author URI: http://wptheming.com
-Version: 0.3
+Version: 0.8
Template: twentyten
*/
Please sign in to comment.
Something went wrong with that request. Please try again.