Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

New 0.8 UI.

  • Loading branch information...
commit 92d4f75891e74528a643acabc72730527335ef69 1 parent 070be49
@devinsays devinsays authored
View
284 admin/css/admin-style.css
@@ -3,266 +3,177 @@
/*-------------------------------------------------------------------------------------------*/
.updated {
- width:770px;
+ max-width:764px;
+ margin-bottom:0px !important;
}
-#of_container {
- margin: 10px 0;
- width: 785px;
+#optionsframework {
position:relative;
z-index: 0;
+ max-width:780px;
+ background:#fff;
}
-#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: 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;
- margin:5px 20px;
+#optionsframework p {
+ margin-bottom:0;
+ padding-bottom:10px;
}
-#of_container #header .logo h2 {
- font-style:normal;
- font-size: 22px;
- line-height: 26px;
+#optionsframework .section {
+ padding:10px 10px 0;
}
-#of_container #main {
- background-color: #f1f1f1;
- border-left: 1px solid #d8d8d8;
- border-right: 1px solid #d8d8d8;
- border-bottom: 1px solid #d8d8d8;
+#optionsframework .group .section:last-of-type {
+ padding-bottom:40px;
}
-#of_container #of-nav {
- float: left;
- position: relative;
- z-index: 9999;
- width: 160px;
-}
-#of_container #of-nav li {
- margin-bottom:0
-}
-#of_container #of-nav ul li a:link, #of-nav ul li a:visited {
- display: block;
- padding: 10px 10px 10px 15px;
- font-family: Georgia, Serif;
- font-size: 13px;
- text-decoration: none;
- color: #797979;
- border-bottom: 1px solid #d8d8d8;
-}
-#of_container #of-nav ul li.current a, #of-nav ul li a:hover {
- color: #21759b;
- background-color: #fff;
-}
-#of_container #content {
- float: left;
- min-height: 560px;
- width: 595px;
- margin-left: -1px;
- padding: 0 14px;
- background-color: #fff;
- border-left: 1px solid #d8d8d8;
-}
-#of_container #content .section {
- margin-bottom: 10px;
+#optionsframework .section .heading {
+ padding:10px 0px;
+ margin:0 0 15px;
+ border-bottom: 1px solid #dfdfdf;
}
-#of_container #content .section h3.heading {
- margin: 10px 0 10px 0;
- padding: 7px 0px;
- border-bottom: 1px solid #e7e7e7;
-}
-#of_container #content .section .controls {
+#optionsframework .section .controls {
float: left;
- width: 345px;
- margin: 0 15px 0 0;
+ min-width:350px;
+ width: 54%;
+ padding-right:2%;
}
-#of_container #content .section .explain {
+#optionsframework .section .explain {
+ max-width:38%;
float: left;
- width: 225px;
- padding: 0 10px 0 0;
- font-size: 11px;
- color: #999999;
+ font-size: 12px;
+ line-height:16px;
+ color: #777;
}
-#of_container #content .section-checkbox .controls {
+#optionsframework .section-checkbox .controls {
+ min-width:25px;
width:25px
}
-#of_container #content .section-checkbox .explain {
- width:540px
+#optionsframework .section-checkbox .explain {
+ max-width:93%;
}
-#of_container #content .section-color .controls {
+#optionsframework .section-color .controls {
+ min-width:125px;
width:125px
}
-#of_container #content .section-color .explain {
- width:440px
-}
-#of_container textarea, #of_container input, #of_container select {
- -moz-border-radius-bottomleft:4px;
- -moz-border-radius-bottomright:4px;
- -moz-border-radius-topleft:4px;
- -moz-border-radius-topright:4px;
- border-style:solid;
- border-width:1px;
-}
-#of_container .controls input, #of_container .controls select, #of_container .controls textarea {
+#optionsframework .controls input, #optionsframework .controls select, #optionsframework .controls textarea {
margin-bottom: 10px;
- background-color: #f1f1f1;
- border: 1px solid;
- border-color: #ccc #e6e6e6 #e6e6e6 #ccc;
- width: 340px;
- padding: 4px;
- font-size: 12px;
-}
-#of_container .controls select {
- padding: 0 0 0 4px;
- width: 340px
-}
-#of_container .controls textarea {
- width: 345px;
+ width:100%;
}
-#of_container input[type=text] {
- width: 340px;
-}
-#of_container input.checkbox {
- width: 30px;
+#optionsframework .section-radio label, #optionsframework .section-multicheck label {
+ float:left;
}
-#of_container input.of-radio {
+#optionsframework input.checkbox, #optionsframework input.of-radio {
width: 30px;
+ float:left;
+ clear:both;
}
-#of_container .controls .of-color {
+#optionsframework .controls .of-color {
float:left;
width: 80px;
margin-left:5px;
+ margin-right:5px;
}
-#of_container #content .section-typography .controls {
- width:425px
-}
-#of_container #content .section-typography .explain {
- width:140px
-}
-#of_container .controls .of-typography-size {
+#optionsframework .controls .of-typography-size {
width:80px;
+ margin-left:5px;
float:left
}
-#of_container .controls .of-typography-unit {
+#optionsframework .controls .of-typography-unit {
width:50px;
+ margin-left:5px;
float:left
}
-#of_container .controls .of-typography-face {
+#optionsframework .controls .of-typography-face {
width:100px;
+ margin-left:5px;
float:left
}
-#of_container .controls .of-typography-style {
+#optionsframework .controls .of-typography-style {
width:80px;
+ margin-left:5px;
+ margin-right:5px;
float:left
}
-#of_container #content .section-background .controls {
- width:425px
-}
-#of_container #content .section-background .explain {
- width:140px
-}
-#of_container .of-background-properties {
+#optionsframework .of-background-properties {
+ clear:both;
margin-top: 18px;
}
-#of_container .controls .of-background-repeat {
- width:160px;
+#optionsframework .controls .of-background-repeat {
+ width:125px;
+ margin-right:5px;
float:left
}
-#of_container .controls .of-background-position {
+#optionsframework .controls .of-background-position {
width:125px;
+ margin-right:5px;
float:left
}
-#of_container .controls .of-background-attachment {
+#optionsframework .controls .of-background-attachment {
width:125px;
+ margin-right:5px;
float:left
}
-#of_container div.section-background .controls input.upload {
- width: 240px;
+#optionsframework div.section-background .controls input.upload {
+ width:47%;
}
-#of_container .controls .of-radio-img-img {
- border:3px solid #fff;
+#optionsframework .controls .of-radio-img-img {
+ border:3px solid #f9f9f9;
margin:0 5px 10px 0;
display:none;
cursor:pointer;
float:left;
}
-#of_container .controls .of-radio-img-selected {
+#optionsframework .controls .of-radio-img-selected {
border:3px solid #ccc
}
-#of_container .controls .of-radio-img-img:hover {
+#optionsframework .controls .of-radio-img-img:hover {
opacity:.8;
}
-#of_container .controls .of-border-width {
+#optionsframework .controls .of-border-width {
width:80px;
float:left
}
-#of_container .controls .of-border-style {
+#optionsframework .controls .of-border-style {
width:120px;
float:left
}
-#of_container .group {
- padding-bottom:20px
-}
-#of_container .group h2 {
- display:none;
- border-bottom:3px solid #e7e7e7
-}
-#of_container .controls input:focus, #of_container select:focus, #of_container textarea:focus {
- background:#fff;
-}
-#of_container .hide {
+#optionsframework .hide {
display:none;
}
-#of_container .of-option-image {
+#optionsframework .of-option-image {
max-width:340px;
margin:3px 0 18px 0;
}
-#of_container .mini .controls select, #of_container #content .section .mini .controls {
- width: 70px;
+#optionsframework .mini .controls select, #optionsframework .section .mini .controls {
+ width: 140px;
}
-#of_container .mini .controls input, #of_container #content .mini .controls {
- width: 70px;
+#optionsframework .mini .controls input, #optionsframework .mini .controls {
+ min-width:140px;
+ width: 140px;
}
-#of_container #content .mini .explain {
- width:500px;
+#optionsframework .mini .explain {
+ max-width:74%;
}
-
/* Image Uploader */
-#of_container .controls input.upload {
- width:280px;
- padding-bottom:6px;
+#optionsframework .controls input.upload {
+ width:80%;
}
-#of_container .controls input.upload_button {
+#optionsframework .controls input.upload_button {
float:right;
width:45px;
border-color:#BBBBBB;
cursor:pointer;
height:16px;
}
-#of_container .controls input.upload_button:hover {
+#optionsframework .controls input.upload_button:hover {
border-color:#666666;
color:#000;
}
-#of_container .screenshot {
+#optionsframework .screenshot {
float:left;
margin-left:1px;
position:relative;
width:344px;
margin-top:3px;
}
-#of_container .section-background .screenshot {
- margin-bottom:18px;
-}
-#of_container .screenshot img {
- -moz-border-radius:4px;
- -webkit-border-radius:4px;
- -border-radius:4px;
+#optionsframework .screenshot img {
background:#FAFAFA;
border-color:#ccc #eee #eee #ccc;
border-style:solid;
@@ -270,11 +181,12 @@
float:left;
max-width:334px;
padding:4px;
+ margin-bottom:10px;
}
-#of_container .screenshot .mlu_remove {
+#optionsframework .screenshot .mlu_remove {
background:url("../images/ico-delete.png") no-repeat;
border:medium none;
- bottom:-4px;
+ bottom:4px;
display:block;
float:left;
height:16px;
@@ -284,33 +196,25 @@
text-indent:-9999px;
width:16px;
}
-#of_container .screenshot .no_image .file_link {
+#optionsframework .screenshot .no_image .file_link {
margin-left: 20px;
}
-#of_container .screenshot .no_image .mlu_remove {
+#optionsframework .screenshot .no_image .mlu_remove {
bottom: 0px;
}
-#of_container .reset-button {
+#optionsframework .reset-button {
float:left;
cursor:pointer;
}
/* Bottom Section */
-#of_container .button-primary {
- float:right;
+#optionsframework-submit {
+ padding: 7px 10px;
+ border-top: 1px solid #ECECEC;
+ background-color: #F1F1F1;
+ background-image: -moz-linear-gradient(center top , #F9F9F9, #ECECEC);
}
-#of_container .of_admin_bar {
- background: #f3f3f3;
- border:solid #ccc;
- border-width:0px 1px 1px 1px;
- padding: 10px 20px 0px 20px;
- height: 35px;
- text-align: right;
- -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;
+#optionsframework .button-primary {
+ float:right;
}
View
10 admin/js/options-custom.js
@@ -52,14 +52,14 @@ jQuery(document).ready(function($) {
});
if (activetab != '' && $(activetab + '-tab').length ) {
- $(activetab + '-tab').parent('li').addClass('current');
+ $(activetab + '-tab').addClass('nav-tab-active');
}
else {
- $('#of-nav li:first').addClass('current');
+ $('.nav-tab-wrapper a:first').addClass('nav-tab-active');
}
- $('#of-nav li a').click(function(evt) {
- $('#of-nav li').removeClass('current');
- $(this).parent().addClass('current');
+ $('.nav-tab-wrapper a').click(function(evt) {
+ $('.nav-tab-wrapper a').removeClass('nav-tab-active');
+ $(this).addClass('nav-tab-active').blur();
var clicked_group = $(this).attr('href');
if (typeof(localStorage) != 'undefined' ) {
localStorage.setItem("activetab", $(this).attr('href'));
View
55 admin/options-framework.php
@@ -49,6 +49,14 @@ function optionsframework_rolescheck () {
}
}
+/* Loads the file for option sanitization */
+
+add_action('init', 'optionsframework_load_sanitization' );
+
+function optionsframework_load_sanitization() {
+ require_once dirname( __FILE__ ) . '/options-sanitize.php';
+}
+
/*
* 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
@@ -62,7 +70,6 @@ function optionsframework_rolescheck () {
function optionsframework_init() {
// Include the required files
- require_once dirname( __FILE__ ) . '/options-sanitize.php';
require_once dirname( __FILE__ ) . '/options-interface.php';
require_once dirname( __FILE__ ) . '/options-medialibrary-uploader.php';
@@ -199,47 +206,31 @@ function of_admin_head() {
if ( !function_exists( 'optionsframework_page' ) ) {
function optionsframework_page() {
-
- // Get the theme name so we can display it up top
- $themename = get_theme_data(STYLESHEETPATH . '/style.css');
- $themename = $themename['Name'];
-
+ $return = optionsframework_fields();
settings_errors();
?>
<div class="wrap">
<?php screen_icon( 'themes' ); ?>
- <h2><?php esc_html_e( 'Theme Options' ); ?></h2>
+ <h2 class="nav-tab-wrapper">
+ <?php echo $return[1]; ?>
+ </h2>
- <div id="of_container">
- <form action="options.php" method="post">
- <?php settings_fields('optionsframework'); ?>
-
- <div id="header">
- <div class="logo">
- <h2><?php esc_html_e( $themename ); ?></h2>
- </div>
- <div class="clear"></div>
- </div>
- <div id="main">
- <?php $return = optionsframework_fields(); ?>
- <div id="of-nav">
- <ul>
- <?php echo $return[1]; ?>
- </ul>
- </div>
- <div id="content">
- <?php echo $return[0]; /* Settings */ ?>
- </div>
- <div class="clear"></div>
- </div>
- <div class="of_admin_bar">
+ <div class="metabox-holder">
+ <div id="optionsframework" class="postbox">
+ <form action="options.php" method="post">
+ <?php settings_fields('optionsframework'); ?>
+
+ <?php echo $return[0]; /* Settings */ ?>
+
+ <div id="optionsframework-submit">
<input type="submit" class="button-primary" name="update" value="<?php esc_attr_e( 'Save Options' ); ?>" />
<input type="submit" class="reset-button button-secondary" name="reset" value="<?php esc_attr_e( 'Restore Defaults' ); ?>" onclick="return confirm( '<?php print esc_js( __( 'Click OK to reset. Any theme settings will be lost!' ) ); ?>' );" />
+ <div class="clear"></div>
</div>
-<div class="clear"></div>
</form>
-</div> <!-- / #container -->
+</div> <!-- / #container -->
+</div>
</div> <!-- / .wrap -->
<?php
View
19 admin/options-interface.php
@@ -8,6 +8,10 @@ function optionsframework_fields() {
global $allowedtags;
$optionsframework_settings = get_option('optionsframework');
+
+ // Get the theme name so we can display it up top
+ $themename = get_theme_data(STYLESHEETPATH . '/style.css');
+ $themename = $themename['Name'];
// Gets the unique option id
if (isset($optionsframework_settings['id'])) {
@@ -48,7 +52,7 @@ function optionsframework_fields() {
}
$output .= '<div id="' . esc_attr( $id ) .'" class="' . esc_attr( $class ) . '">'."\n";
- $output .= '<h3 class="heading">' . esc_html( $value['name'] ) . '</h3>' . "\n";
+ $output .= '<h4 class="heading">' . esc_html( $value['name'] ) . '</h4>' . "\n";
$output .= '<div class="option">' . "\n" . '<div class="controls">' . "\n";
}
@@ -112,7 +116,7 @@ function optionsframework_fields() {
$name = $option_name .'['. $value['id'] .']';
foreach ($value['options'] as $key => $option) {
$id = $option_name . '-' . $value['id'] .'-'. $key;
- $output .= '<input class="of-input of-radio" type="radio" name="' . esc_attr( $name ) . '" id="' . esc_attr( $id ) . '" value="'. esc_attr( $key ) . '" '. checked( $val, $key, false) .' /><label for="' . esc_attr( $id ) . '">' . esc_html( $option ) . '</label><br />';
+ $output .= '<input class="of-input of-radio" type="radio" name="' . esc_attr( $name ) . '" id="' . esc_attr( $id ) . '" value="'. esc_attr( $key ) . '" '. checked( $val, $key, false) .' /><label for="' . esc_attr( $id ) . '">' . esc_html( $option ) . '</label>';
}
break;
@@ -153,7 +157,7 @@ function optionsframework_fields() {
$checked = checked($val[$option], 1, false);
}
- $output .= '<input id="' . esc_attr( $id ) . '" class="checkbox of-input" type="checkbox" name="' . esc_attr( $name ) . '" ' . $checked . ' /><label for="' . esc_attr( $id ) . '">' . esc_html( $label ) . '</label><br />';
+ $output .= '<input id="' . esc_attr( $id ) . '" class="checkbox of-input" type="checkbox" name="' . esc_attr( $name ) . '" ' . $checked . ' /><label for="' . esc_attr( $id ) . '">' . esc_html( $label ) . '</label>';
}
break;
@@ -270,10 +274,10 @@ function optionsframework_fields() {
$output .= '<div class="' . esc_attr( $class ) . '">' . "\n";
if ( isset($value['name']) ) {
- $output .= '<h3 class="heading">' . esc_html( $value['name'] ) . '</h3>' . "\n";
+ $output .= '<h4 class="heading">' . esc_html( $value['name'] ) . '</h4>' . "\n";
}
if ( $value['desc'] ) {
- $output .= wpautop( wp_kses( $value['desc'], $allowedtags) ) . "\n";
+ $output .= apply_filters('of_sanitize_info', $value['desc'] ) . "\n";
}
$output .= '<div class="clear"></div></div>' . "\n";
break;
@@ -285,8 +289,9 @@ function optionsframework_fields() {
}
$jquery_click_hook = preg_replace('/\W/', '', strtolower($value['name']) );
$jquery_click_hook = "of-option-" . $jquery_click_hook;
- $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";
+ $menu .= '<a id="'. esc_attr( $jquery_click_hook ) . '-tab" class="nav-tab" title="' . esc_attr( $value['name'] ) . '" href="' . esc_attr( '#'. $jquery_click_hook ) . '">' . esc_html( $value['name'] ) . '</a>';
+ $output .= '<div class="group" id="' . esc_attr( $jquery_click_hook ) . '">';
+ $output .= '<h3>' . esc_html( $value['name'] ) . '</h3>' . "\n";
break;
}
View
10 admin/options-sanitize.php
@@ -14,6 +14,16 @@ function of_sanitize_textarea($input) {
add_filter( 'of_sanitize_textarea', 'of_sanitize_textarea' );
+/* Info */
+
+function of_sanitize_allowedtags($input) {
+ global $allowedtags;
+ $output = wpautop(wp_kses( $input, $allowedtags));
+ return $output;
+}
+
+add_filter( 'of_sanitize_info', 'of_sanitize_allowedtags' );
+
/* Select */
add_filter( 'of_sanitize_select', 'of_sanitize_enum', 10, 2);
View
10 functions.php
@@ -44,4 +44,14 @@ function optionsframework_custom_scripts() { ?>
</script>
<?php
+}
+
+/*
+ * Turns off the default options panel from Twenty Eleven
+ */
+
+add_action('after_setup_theme','remove_twentyeleven_options', 100);
+
+function remove_twentyeleven_options() {
+ remove_action( 'admin_menu', 'twentyeleven_theme_options_add_page' );
}
View
BIN  images/1col.png 100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/2cl.png 100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/2cr.png 100755 → 100644
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/3cm.png
Deleted file not rendered
View
BIN  images/3cr.png
Deleted file not rendered
View
363 index.php
@@ -1,191 +1,194 @@
<?php
/**
- * This theme is purely for the purpose of testing to see if theme options are working.
+ * The main template file.
+ *
+ * This theme is purely for the purpose of testing theme options in Options Framework plugin.
*
* @package WordPress
- * @subpackage Twenty_Ten
- * @since Twenty Ten 1.0
+ * @subpackage Options Check
*/
get_header(); ?>
- <div id="container">
+ <div id="primary">
<div id="content" role="main">
-
- <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
- <h2 class="entry-title">Options Check Theme</h2>
-
- <div class="entry-content">
-
- <p>Use of_of_get_option($id,$default) to return option values.</p>
-
- <h3>Basic Options</h3>
-
- <dl>
- <dt>type: text (mini)</dt>
- <dd>of_get_option('example_text_mini'): <?php echo of_get_option('example_text_mini', 'no entry'); ?></dd>
- </dl>
-
- <dl>
- <dt>type: text</dt>
- <dd>of_get_option('example_text'): <?php echo of_get_option('example_text', 'no entry'); ?></dd>
- </dl>
-
- <dl>
- <dt>type: textarea</dt>
- <dd>of_get_option('example_textarea'): <?php echo of_get_option('example_textarea', 'no entry' ); ?></dd>
- </dl>
-
- <dl>
- <dt>type: select (mini)</dt>
- <dd>of_get_option('example_select'): <?php echo of_get_option('example_select', 'no entry' ); ?></dd>
- </dl>
-
- <dl>
- <dt>type: select2 (wide)</dt>
- <dd>of_get_option('example_select_wide'): <?php echo of_get_option('example_select_wide', 'no entry' ); ?></dd>
- </dl>
-
- <dl>
- <dt>type: select</dt>
- <dd>of_get_option('example_select_categories'): category id = <?php echo of_get_option('example_select_categories', 'no entry' ); ?></dd>
- </dl>
-
- <dl>
- <dt>type: select</dt>
- <dd>of_get_option('example_select_pages'): page id = <?php echo of_get_option('example_select_pages', 'no entry' ); ?></dd>
- </dl>
-
- <dl>
- <dt>type: radio</dt>
- <dd>of_get_option('example_radio'): <?php echo of_get_option('example_radio', 'no entry' ); ?></dd>
- </dl>
-
- <dl>
- <dt>type: checkbox</dt>
- <dd>of_get_option('example_checkbox'): <?php echo of_get_option('example_checkbox', 'no entry' ); ?></dd>
- </dl>
-
- <hr/>
-
- <h3>Advanced Options</h3>
-
- <dl>
- <dt>type: uploader</dt>
- <dd>of_get_option('example_uploader'): <?php echo of_get_option('example_uploader', 'no entry'); ?></dd>
- <?php if ( of_get_option('example_uploader') ) { ?>
- <img src="<?php echo of_get_option('example_uploader'); ?>" />
- <?php } ?>
- </dl>
-
- <dl>
- <dt>type: image</dt>
- <dd>of_get_option('images'): <?php echo of_get_option('example_images', 'no entry' ); ?></dd>
- </dl>
-
- <dl>
- <dt>type: multicheck</dt>
- <dd>of_get_option('multicheck'):
- <?php $multicheck = of_get_option('example_multicheck', 'none' ); ?>
- <?php print_r($multicheck); ?>
- </dd>
- </dl>
-
- <p>The array sent in the options panel was defined as:<br>
- <?php
- $test_array_jr = array("one" => "French Toast","two" => "Pancake","three" => "Omelette","four" => "Crepe","five" => "Waffle");
- print_r($test_array_jr);
- ?>
- </p>
-
- <p>You can get the value of all items in the checkbox array:</p>
- <ul>
- <?php
- if ( is_array($multicheck) ) {
- foreach ($multicheck as $key => $value) {
- // If you need the option's name rather than the key you can get that
- $name = $test_array_jr[$key];
- // Prints out each of the values
- echo '<li>' . $key . ' (' . $name . ') = ' . $value . '</li>';
- }
- }
- else {
- echo '<li>There are no saved values yet.</li>';
- }
- ?>
- </ul>
-
- <p>You can also get an individual checkbox value if you know what you are looking for. In this example, I'll check for the key "one", which is an item I sent in the array for checkboxes:</p>
-
- <p>The value of the multicheck box "one" of example_multicheck is:
- <b>
- <?php
- if (isset($multicheck['one']) ) {
- echo $multicheck['one'];
- } else {
- echo 'no entry';
- }
- ?>
- </b>
- </p>
-
-
- <dl>
- <dt>type: background</dt>
- <dd>of_get_option('background'):
- <?php $background = of_get_option('example_background');
- if ($background) {
- if ($background['image']) {
- echo '<span style="display: block; height: 200px; width: 200px; background:url('.$background['image']. ') "></span>';
- echo '<ul>';
- foreach ($background as $i=>$param){
- echo '<li>'.$i . ' = ' . $param.'</li>';
- }
- echo '</ul>';
- } else {
- echo '<span style="display: inline-block; height: 20px; width: 20px; background:'.$background['color']. ' "></span>';
- echo '<ul>';
- echo '<li>'.$background['color'].'</li>';
- echo '</ul>';
- }
- } else {
- echo "no entry";
- }; ?>
- </span>
- </dd>
- </dl>
-
- <dl>
- <dt>type: colorpicker</dt>
- <dd>of_get_option('colorpicker'):
- <span style="color:<?php echo of_get_option('example_colorpicker', '#000' ); ?>">
- <?php echo of_get_option('example_colorpicker', 'no entry' ); ?>
- </span>
- </dd>
- </dl>
-
- <dl>
- <dt>type: typography</dt>
- <dd>of_get_option('typography'):
- <?php $typography = of_get_option('example_typography');
- if ($typography) {
- echo '<span style="font:'.$typography['size'] . ' ' . $typography['face']. ' ' . $typography['style'] . '; color:'.$typography['color'].';">Some sample text in your style</span>';
-
- echo '<ul>';
- foreach ($typography as $i=>$param) {
- echo '<li>'.$i . ' = ' . $param.'</li>';
- }
- echo '</ul>';
- } else {
- echo "no entry";
- } ?>
- </dd>
- </dl>
-
- </div>
- </div>
-
+
+ <article id="post-0" class="post no-results not-found">
+ <header class="entry-header">
+ <h1 class="entry-title">Options Check</h1>
+ </header><!-- .entry-header -->
+
+ <div class="entry-content">
+ <p>Use of_of_get_option($id,$default) to return option values.</p>
+
+ <h2>Basic Options</h2>
+
+ <dl>
+ <dt>type: text (mini)</dt>
+ <dd>of_get_option('example_text_mini'): <?php echo of_get_option('example_text_mini', 'no entry'); ?></dd>
+ </dl>
+
+ <dl>
+ <dt>type: text</dt>
+ <dd>of_get_option('example_text'): <?php echo of_get_option('example_text', 'no entry'); ?></dd>
+ </dl>
+
+ <dl>
+ <dt>type: textarea</dt>
+ <dd>of_get_option('example_textarea'): <?php echo of_get_option('example_textarea', 'no entry' ); ?></dd>
+ </dl>
+
+ <dl>
+ <dt>type: select (mini)</dt>
+ <dd>of_get_option('example_select'): <?php echo of_get_option('example_select', 'no entry' ); ?></dd>
+ </dl>
+
+ <dl>
+ <dt>type: select2 (wide)</dt>
+ <dd>of_get_option('example_select_wide'): <?php echo of_get_option('example_select_wide', 'no entry' ); ?></dd>
+ </dl>
+
+ <dl>
+ <dt>type: select</dt>
+ <dd>of_get_option('example_select_categories'): category id = <?php echo of_get_option('example_select_categories', 'no entry' ); ?></dd>
+ </dl>
+
+ <dl>
+ <dt>type: select</dt>
+ <dd>of_get_option('example_select_pages'): page id = <?php echo of_get_option('example_select_pages', 'no entry' ); ?></dd>
+ </dl>
+
+ <dl>
+ <dt>type: radio</dt>
+ <dd>of_get_option('example_radio'): <?php echo of_get_option('example_radio', 'no entry' ); ?></dd>
+ </dl>
+
+ <dl>
+ <dt>type: checkbox</dt>
+ <dd>of_get_option('example_checkbox'): <?php echo of_get_option('example_checkbox', 'no entry' ); ?></dd>
+ </dl>
+
+ <hr/>
+
+ <h2>Advanced Options</h2>
+
+ <dl>
+ <dt>type: uploader</dt>
+ <dd>of_get_option('example_uploader'): <?php echo of_get_option('example_uploader', 'no entry'); ?></dd>
+ <?php if ( of_get_option('example_uploader') ) { ?>
+ <img src="<?php echo of_get_option('example_uploader'); ?>" />
+ <?php } ?>
+ </dl>
+
+ <dl>
+ <dt>type: image</dt>
+ <dd>of_get_option('images'): <?php echo of_get_option('example_images', 'no entry' ); ?></dd>
+ </dl>
+
+ <dl>
+ <dt>type: multicheck</dt>
+ <dd>of_get_option('multicheck'):
+ <?php $multicheck = of_get_option('example_multicheck', 'none' ); ?>
+ <?php print_r($multicheck); ?>
+ </dd>
+ </dl>
+
+ <p>The array sent in the options panel was defined as:<br>
+ <?php
+ $test_array_jr = array("one" => "French Toast","two" => "Pancake","three" => "Omelette","four" => "Crepe","five" => "Waffle");
+ print_r($test_array_jr);
+ ?>
+ </p>
+
+ <p>You can get the value of all items in the checkbox array:</p>
+ <ul>
+ <?php
+ if ( is_array($multicheck) ) {
+ foreach ($multicheck as $key => $value) {
+ // If you need the option's name rather than the key you can get that
+ $name = $test_array_jr[$key];
+ // Prints out each of the values
+ echo '<li>' . $key . ' (' . $name . ') = ' . $value . '</li>';
+ }
+ }
+ else {
+ echo '<li>There are no saved values yet.</li>';
+ }
+ ?>
+ </ul>
+
+ <p>You can also get an individual checkbox value if you know what you are looking for. In this example, I'll check for the key "one", which is an item I sent in the array for checkboxes:</p>
+
+ <p>The value of the multicheck box "one" of example_multicheck is:
+ <b>
+ <?php
+ if (isset($multicheck['one']) ) {
+ echo $multicheck['one'];
+ } else {
+ echo 'no entry';
+ }
+ ?>
+ </b>
+ </p>
+
+
+ <dl>
+ <dt>type: background</dt>
+ <dd>of_get_option('background'):
+ <?php $background = of_get_option('example_background');
+ if ($background) {
+ if ($background['image']) {
+ echo '<span style="display: block; height: 200px; width: 200px; background:url('.$background['image']. ') "></span>';
+ echo '<ul>';
+ foreach ($background as $i=>$param){
+ echo '<li>'.$i . ' = ' . $param.'</li>';
+ }
+ echo '</ul>';
+ } else {
+ echo '<span style="display: inline-block; height: 20px; width: 20px; background:'.$background['color']. ' "></span>';
+ echo '<ul>';
+ echo '<li>'.$background['color'].'</li>';
+ echo '</ul>';
+ }
+ } else {
+ echo "no entry";
+ }; ?>
+ </span>
+ </dd>
+ </dl>
+
+ <dl>
+ <dt>type: colorpicker</dt>
+ <dd>of_get_option('colorpicker'):
+ <span style="color:<?php echo of_get_option('example_colorpicker', '#000' ); ?>">
+ <?php echo of_get_option('example_colorpicker', 'no entry' ); ?>
+ </span>
+ </dd>
+ </dl>
+
+ <dl>
+ <dt>type: typography</dt>
+ <dd>of_get_option('typography'):
+ <?php $typography = of_get_option('example_typography');
+ if ($typography) {
+ echo '<span style="font:'.$typography['size'] . ' ' . $typography['face']. ' ' . $typography['style'] . '; color:'.$typography['color'].';">Some sample text in your style</span>';
+
+ echo '<ul>';
+ foreach ($typography as $i=>$param) {
+ echo '<li>'.$i . ' = ' . $param.'</li>';
+ }
+ echo '</ul>';
+ } else {
+ echo "no entry";
+ } ?>
+ </dd>
+ </dl>
+
+ </div><!-- .entry-content -->
+ </article><!-- #post-0 -->
+
+
</div><!-- #content -->
- </div><!-- #container -->
-
+ </div><!-- #primary -->
+
<?php get_footer(); ?>
View
4 options.php
@@ -155,10 +155,8 @@ function optionsframework_options() {
"type" => "images",
"options" => array(
'1col-fixed' => $imagepath . '1col.png',
- '2c-r-fixed' => $imagepath . '2cr.png',
'2c-l-fixed' => $imagepath . '2cl.png',
- '3c-fixed' => $imagepath . '3cm.png',
- '3c-r-fixed' => $imagepath . '3cr.png')
+ '2c-r-fixed' => $imagepath . '2cr.png')
);
$options[] = array( "name" => "Example Background",
View
BIN  screenshot.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
6 style.css
@@ -5,9 +5,9 @@ Description: An example/test theme with a complete theme options panel.
Author: Devin Price
Author URI: http://wptheming.com
Version: 0.8
-Template: twentyten
+Template: twentyeleven
*/
-@import url('../twentyten/style.css');
+@import url('../twentyeleven/style.css');
-#header img {display:none;}
+#branding hgroup, #searchform, #branding img, #access {display:none;}
Please sign in to comment.
Something went wrong with that request. Please try again.