Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Minor code cleanup. Simplify functions.php.

  • Loading branch information...
commit e0e38f61afdbf11275915e7ba41a01ce74b3e3f8 1 parent 170a5bc
Devin Price authored
5  admin/options-framework.php
@@ -4,6 +4,7 @@
4 4
 Author: Devin Price
5 5
 Author URI: http://www.wptheming.com
6 6
 License: GPLv2
  7
+Version: 1.0
7 8
 */
8 9
 
9 10
 /*
@@ -22,10 +23,6 @@
22 23
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
23 24
 */
24 25
 
25  
-/* Basic plugin definitions */
26  
-
27  
-define('OPTIONS_FRAMEWORK_VERSION', '1.0');
28  
-
29 26
 /* Make sure we don't expose any info if called directly */
30 27
 
31 28
 if ( !function_exists( 'add_action' ) ) {
40  functions.php
@@ -5,42 +5,6 @@
5 5
  */
6 6
  
7 7
 if ( !function_exists( 'optionsframework_init' ) ) {
8  
-
9  
-	/* Set the file path based on whether we're in a child theme or parent theme */
10  
-
11  
-	if ( STYLESHEETPATH == TEMPLATEPATH ) {
12  
-		define('OPTIONS_FRAMEWORK_URL', TEMPLATEPATH . '/admin/');
13  
-		define('OPTIONS_FRAMEWORK_DIRECTORY', get_bloginfo('template_directory') . '/admin/');
14  
-	} else {
15  
-		define('OPTIONS_FRAMEWORK_URL', STYLESHEETPATH . '/admin/');
16  
-		define('OPTIONS_FRAMEWORK_DIRECTORY', get_bloginfo('stylesheet_directory') . '/admin/');
17  
-	}
18  
-
19  
-	require_once (OPTIONS_FRAMEWORK_URL . 'options-framework.php');
20  
-}
21  
-
22  
-/* 
23  
- * This is an example of how to add custom scripts to the options panel.
24  
- * This example shows/hides an option when a checkbox is clicked.
25  
- */
26  
-
27  
-add_action('optionsframework_custom_scripts', 'optionsframework_custom_scripts');
28  
-
29  
-function optionsframework_custom_scripts() { ?>
30  
-
31  
-<script type="text/javascript">
32  
-jQuery(document).ready(function() {
33  
-
34  
-	jQuery('#example_showhidden').click(function() {
35  
-  		jQuery('#section-example_text_hidden').fadeToggle(400);
36  
-	});
37  
-	
38  
-	if (jQuery('#example_showhidden:checked').val() !== undefined) {
39  
-		jQuery('#section-example_text_hidden').show();
40  
-	}
41  
-	
42  
-});
43  
-</script>
44  
-
45  
-<?php
  8
+	define( 'OPTIONS_FRAMEWORK_DIRECTORY', get_bloginfo('template_directory') . '/admin/' );
  9
+	require_once dirname( __FILE__ ) . '/admin/options-framework.php';
46 10
 }
26  options.php
@@ -181,4 +181,30 @@ function optionsframework_options() {
181 181
 						"std" => array('size' => '12px','face' => 'verdana','style' => 'bold italic','color' => '#123456'),
182 182
 						"type" => "typography");			
183 183
 	return $options;
  184
+}
  185
+
  186
+/* 
  187
+ * This is an example of how to add custom scripts to the options panel.
  188
+ * This example shows/hides an option when a checkbox is clicked.
  189
+ */
  190
+
  191
+add_action('optionsframework_custom_scripts', 'optionsframework_custom_scripts');
  192
+
  193
+function optionsframework_custom_scripts() { ?>
  194
+
  195
+<script type="text/javascript">
  196
+jQuery(document).ready(function($) {
  197
+
  198
+	$('#example_showhidden').click(function() {
  199
+  		$('#section-example_text_hidden').fadeToggle(400);
  200
+	});
  201
+	
  202
+	if ($('#example_showhidden:checked').val() !== undefined) {
  203
+		$('#section-example_text_hidden').show();
  204
+	}
  205
+	
  206
+});
  207
+</script>
  208
+
  209
+<?php
184 210
 }
11  readme.txt
... ...
@@ -1,9 +1,10 @@
1  
-=== Options Framework ===
  1
+=== Options Framework Theme ===
  2
+
2 3
 Contributors: Devin Price
3 4
 Tags: options, theme options
4  
-Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=X238BDP4QGTV2
  5
+Donate link: http://bit.ly/options-donate
5 6
 Requires at least: 3.0
6  
-Tested up to: 3.2
  7
+Tested up to: 3.3
7 8
 Stable tag: 1.0
8 9
 License: GPLv2
9 10
 
@@ -39,8 +40,10 @@ You can also watch the video screencast I have at [http://wptheming.com/options-
39 40
 
40 41
 == Changelog ==
41 42
 
42  
-= Development =
  43
+= Other Updates =
43 44
 
  45
+* Move js example from functions.php options.php
  46
+* Simplify functions.php, no check for child theme now
44 47
 * Display admin menu link only if user has permissions (props @mindctrl)
45 48
 
46 49
 = 1.0 =

0 notes on commit e0e38f6

Please sign in to comment.
Something went wrong with that request. Please try again.