Permalink
Browse files

Minor code cleanup. Simplify functions.php.

  • Loading branch information...
devinsays committed Apr 1, 2012
1 parent 170a5bc commit e0e38f61afdbf11275915e7ba41a01ce74b3e3f8
Showing with 36 additions and 46 deletions.
  1. +1 −4 admin/options-framework.php
  2. +2 −38 functions.php
  3. +26 −0 options.php
  4. +7 −4 readme.txt
@@ -4,6 +4,7 @@
Author: Devin Price
Author URI: http://www.wptheming.com
License: GPLv2
+Version: 1.0
*/
/*
@@ -22,10 +23,6 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-/* Basic plugin definitions */
-
-define('OPTIONS_FRAMEWORK_VERSION', '1.0');
-
/* Make sure we don't expose any info if called directly */
if ( !function_exists( 'add_action' ) ) {
View
@@ -5,42 +5,6 @@
*/
if ( !function_exists( 'optionsframework_init' ) ) {
-
- /* Set the file path based on whether we're in a child theme or parent theme */
-
- if ( STYLESHEETPATH == TEMPLATEPATH ) {
- define('OPTIONS_FRAMEWORK_URL', TEMPLATEPATH . '/admin/');
- define('OPTIONS_FRAMEWORK_DIRECTORY', get_bloginfo('template_directory') . '/admin/');
- } else {
- define('OPTIONS_FRAMEWORK_URL', STYLESHEETPATH . '/admin/');
- define('OPTIONS_FRAMEWORK_DIRECTORY', get_bloginfo('stylesheet_directory') . '/admin/');
- }
-
- require_once (OPTIONS_FRAMEWORK_URL . 'options-framework.php');
-}
-
-/*
- * This is an example of how to add custom scripts to the options panel.
- * This example shows/hides 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
+ define( 'OPTIONS_FRAMEWORK_DIRECTORY', get_bloginfo('template_directory') . '/admin/' );
+ require_once dirname( __FILE__ ) . '/admin/options-framework.php';
}
View
@@ -181,4 +181,30 @@ function optionsframework_options() {
"std" => array('size' => '12px','face' => 'verdana','style' => 'bold italic','color' => '#123456'),
"type" => "typography");
return $options;
+}
+
+/*
+ * This is an example of how to add custom scripts to the options panel.
+ * This example shows/hides 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($) {
+
+ $('#example_showhidden').click(function() {
+ $('#section-example_text_hidden').fadeToggle(400);
+ });
+
+ if ($('#example_showhidden:checked').val() !== undefined) {
+ $('#section-example_text_hidden').show();
+ }
+
+});
+</script>
+
+<?php
}
View
@@ -1,9 +1,10 @@
-=== Options Framework ===
+=== Options Framework Theme ===
+
Contributors: Devin Price
Tags: options, theme options
-Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=X238BDP4QGTV2
+Donate link: http://bit.ly/options-donate
Requires at least: 3.0
-Tested up to: 3.2
+Tested up to: 3.3
Stable tag: 1.0
License: GPLv2
@@ -39,8 +40,10 @@ You can also watch the video screencast I have at [http://wptheming.com/options-
== Changelog ==
-= Development =
+= Other Updates =
+* Move js example from functions.php options.php
+* Simplify functions.php, no check for child theme now
* Display admin menu link only if user has permissions (props @mindctrl)
= 1.0 =

0 comments on commit e0e38f6

Please sign in to comment.