Widgets on Pages - Version 0.0.4

Version Description

There is now no longer a limit on the number of sidebars that can be defined. Each sidebar can be called independently.

Download this release

Release Info

Developer toddhalfpenny
Plugin Icon 128x128 Widgets on Pages
Version 0.0.4
Comparing to
See all releases

Code changes from version 0.0.3 to 0.0.4

Files changed (2) hide show
  1. readme.txt +7 -3
  2. widgets_on_pages.php +19 -13
readme.txt CHANGED
@@ -4,14 +4,14 @@ Donate link: n/a
4
  Tags: widgets, sidebar, pages, post, shortcode, inline
5
  Requires at least: 2.8
6
  Tested up to: 2.9.2
7
- Stable tag: 0.0.3
8
 
9
  Allows 'in-page' widget areas so widgets can be defined via shortcode straight into page/post content
10
 
11
  == Description ==
12
 
13
  Allows 'in-page' widget areas so widgets can be defined via shortcut straight into page/post content.
14
- There is one default widget area that can be used or you can add more from the settings menu. You can currently have up to 5 widget areas (sidebars).
15
  Each sidebar can be called indepentenly by a shortcode and you can call more than one per post/page.
16
 
17
 
@@ -28,7 +28,7 @@ Each sidebar can be called indepentenly by a shortcode and you can call more th
28
 
29
  = Can I have more than one defined sidebar area =
30
 
31
- Yes... there can be up to 5 sidebars defined. The number available can be administered via the settings menu.
32
 
33
  == Screenshots ==
34
 
@@ -36,6 +36,10 @@ Yes... there can be up to 5 sidebars defined. The number available can be admini
36
 
37
  == Changelog ==
38
 
 
 
 
 
39
  = 0.0.3 =
40
 
41
  The number of sidebars can now be defined via the settings menu. There can be up to 5 defined. Each sidebar can be called independently.
4
  Tags: widgets, sidebar, pages, post, shortcode, inline
5
  Requires at least: 2.8
6
  Tested up to: 2.9.2
7
+ Stable tag: 0.0.4
8
 
9
  Allows 'in-page' widget areas so widgets can be defined via shortcode straight into page/post content
10
 
11
  == Description ==
12
 
13
  Allows 'in-page' widget areas so widgets can be defined via shortcut straight into page/post content.
14
+ There is one default widget area that can be used or you can add more from the settings menu. You can currently have an unlimited number of sidebars.
15
  Each sidebar can be called indepentenly by a shortcode and you can call more than one per post/page.
16
 
17
 
28
 
29
  = Can I have more than one defined sidebar area =
30
 
31
+ Yes... you can have an unlimited number of sidebars defined. The number available can be administered via the settings menu.
32
 
33
  == Screenshots ==
34
 
36
 
37
  == Changelog ==
38
 
39
+ = 0.0.4 =
40
+
41
+ There is now no longer a limit on the number of sidebars that can be defined. Each sidebar can be called independently.
42
+
43
  = 0.0.3 =
44
 
45
  The number of sidebars can now be defined via the settings menu. There can be up to 5 defined. Each sidebar can be called independently.
widgets_on_pages.php CHANGED
@@ -22,7 +22,7 @@ Plugin Name: Widgets on Pages
22
  Plugin URI: http://gingerbreaddesign.co.uk/wordpress/plugins/widgets-on-pages.php
23
  Description: Allows 'in-page' widget areas so widgets can be defined via shortcut straight into page/post content
24
  Author: Todd Halfpenny
25
- Version: 0.0.3
26
  Author URI: http://gingerbreaddesign.co.uk/todd
27
  */
28
 
@@ -58,22 +58,28 @@ function wop_plugin_options() {
58
  <?php settings_fields( 'wop_options' ); ?>
59
  <? $cur_num_sidebars = get_option('num_of_wop_sidebars');?>
60
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  <table class="form-table">
62
 
63
  <tr valign="top">
64
  <th scope="row">Number of additional sidebars</th>
65
- <td><input type="hidden" size='3' value="<? echo get_option('num_of_wop_sidebars');?>" />
66
- <select name="num_of_wop_sidebars">
67
- <?php
68
- for ( $num_sidebars = 0; $num_sidebars <= 5; $num_sidebars++){
69
- if ($num_sidebars == $cur_num_sidebars) :
70
- echo "<option name='num_of_wop_sidebars' selected value='$num_sidebars'>$num_sidebars&nbsp;</option>";
71
- else :
72
- echo "<option name='num_of_wop_sidebars' value='$num_sidebars'>$num_sidebars&nbsp;</option>";
73
- endif;
74
- }
75
- ?>
76
- </select>
77
  </table>
78
  <input type="hidden" name="action" value="update" />
79
  <input type="hidden" name="page_options" value="num_of_wop_sidebars" />
22
  Plugin URI: http://gingerbreaddesign.co.uk/wordpress/plugins/widgets-on-pages.php
23
  Description: Allows 'in-page' widget areas so widgets can be defined via shortcut straight into page/post content
24
  Author: Todd Halfpenny
25
+ Version: 0.0.4
26
  Author URI: http://gingerbreaddesign.co.uk/todd
27
  */
28
 
58
  <?php settings_fields( 'wop_options' ); ?>
59
  <? $cur_num_sidebars = get_option('num_of_wop_sidebars');?>
60
 
61
+ <script language="JavaScript">
62
+ function validate(evt) {
63
+ var theEvent = evt || window.event;
64
+ var key = theEvent.keyCode || theEvent.which;
65
+ if ((key == 8) || (key == 9) || (key == 13)) {
66
+ }
67
+ else {
68
+ key = String.fromCharCode( key );
69
+ var regex = /[0-9]|\./;
70
+ if( !regex.test(key) ) {
71
+ theEvent.returnValue = false;
72
+ theEvent.preventDefault();
73
+ }
74
+ }
75
+ }
76
+ </script>
77
+
78
  <table class="form-table">
79
 
80
  <tr valign="top">
81
  <th scope="row">Number of additional sidebars</th>
82
+ <td><input type='text' name="num_of_wop_sidebars" size='3' value="<? echo get_option('num_of_wop_sidebars');?>" onkeypress='validate(event)' />
 
 
 
 
 
 
 
 
 
 
 
83
  </table>
84
  <input type="hidden" name="action" value="update" />
85
  <input type="hidden" name="page_options" value="num_of_wop_sidebars" />