Version Description
- Resolve potential conflicts with other plugins (contextual help callback).
- Fixed bug so that Widgets settings are not lost when switching themes. Credit to wesleong over at WordPress.org forums for getting this fix on the right track!
- Add settings link on main dashboard plugins page
Download this release
Release Info
Developer | toddhalfpenny |
Plugin | Widgets on Pages |
Version | 0.0.8 |
Comparing to | |
See all releases |
Code changes from version 0.0.7 to 0.0.8
- readme.txt +9 -2
- widgets_on_pages.php +34 -19
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: toddhalfpenny
|
|
3 |
Donate link: http://gingerbreaddesign.co.uk/wordpress/plugins/plugins.php
|
4 |
Tags: widgets, sidebar, pages, post, shortcode, inline
|
5 |
Requires at least: 2.8
|
6 |
-
Tested up to: 3.
|
7 |
-
Stable tag: 0.0.
|
8 |
|
9 |
Allows 'in-page' widget areas so widgets can be defined via shortcode straight into page/post content. The widgets/sidebars can also be added through the use of template tags.
|
10 |
|
@@ -50,6 +50,13 @@ Yes... you can have an unlimited number of sidebars defined. The number availabl
|
|
50 |
|
51 |
== Changelog ==
|
52 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
= 0.0.7 =
|
54 |
|
55 |
1. Resolve conflict with YouTube Lyte plugin (thanks to Massa P for the tip off)
|
3 |
Donate link: http://gingerbreaddesign.co.uk/wordpress/plugins/plugins.php
|
4 |
Tags: widgets, sidebar, pages, post, shortcode, inline
|
5 |
Requires at least: 2.8
|
6 |
+
Tested up to: 3.1
|
7 |
+
Stable tag: 0.0.8
|
8 |
|
9 |
Allows 'in-page' widget areas so widgets can be defined via shortcode straight into page/post content. The widgets/sidebars can also be added through the use of template tags.
|
10 |
|
50 |
|
51 |
== Changelog ==
|
52 |
|
53 |
+
= 0.0.8 =
|
54 |
+
|
55 |
+
1. Resolve potential conflicts with other plugins (contextual help callback).
|
56 |
+
1. Fixed bug so that Widgets settings are not lost when switching themes. Credit to wesleong over at WordPress.org forums for getting this fix on the right track!
|
57 |
+
1. Add settings link on main dashboard plugins page
|
58 |
+
|
59 |
+
|
60 |
= 0.0.7 =
|
61 |
|
62 |
1. Resolve conflict with YouTube Lyte plugin (thanks to Massa P for the tip off)
|
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 or through the use of a template tag.
|
24 |
Author: Todd Halfpenny
|
25 |
-
Version: 0.0.
|
26 |
Author URI: http://gingerbreaddesign.co.uk/todd
|
27 |
*/
|
28 |
|
@@ -40,6 +40,24 @@ function wop_menu() {
|
|
40 |
}
|
41 |
|
42 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
function register_wop_settings() { // whitelist options
|
44 |
register_setting( 'wop_options', 'wop_options_field' );
|
45 |
}
|
@@ -134,7 +152,7 @@ function wop_install() {
|
|
134 |
/* ===============================
|
135 |
C O N T E X T U A L H E L P
|
136 |
================================*/
|
137 |
-
function
|
138 |
$screen = $_GET['page'];
|
139 |
if ($screen == 'wop_options') {
|
140 |
$text = "<h5>Need help with the Widgets on Pages plugin?</h5>";
|
@@ -144,7 +162,7 @@ function my_contextual_help($text) {
|
|
144 |
return $text;
|
145 |
}
|
146 |
|
147 |
-
add_action('contextual_help', '
|
148 |
|
149 |
|
150 |
/* ===============================
|
@@ -194,18 +212,17 @@ function reg_wop_sidebar() {
|
|
194 |
if ( function_exists('register_sidebar') )
|
195 |
if ($options['wop_name_1'] != "") :
|
196 |
$name = $options['wop_name_1'];
|
197 |
-
$sidebar_id = ' id="' .$name . '"';
|
198 |
else :
|
199 |
$name = 'Widgets on Pages 1';
|
200 |
-
|
201 |
-
|
202 |
-
$id = 'wop_1';
|
203 |
$desc = '#1 Widgets on Pages sidebar.
|
204 |
Use shortcode
|
205 |
"[widgets_on_pages' . $sidebar_id .']"';
|
206 |
register_sidebar(array(
|
207 |
-
'name' => __( $name, 'wop' ),
|
208 |
-
|
|
|
209 |
'before_widget' => '<li id="%1$s" class="widget %2$s">',
|
210 |
'after_widget' => '</li>',
|
211 |
'before_title' => '<h2 class="widgettitle">',
|
@@ -219,28 +236,26 @@ register_sidebar(array(
|
|
219 |
$option_id = 'wop_name_' . $sidebar;
|
220 |
if ($options[$option_id] != "") :
|
221 |
$name = $options[$option_id];
|
222 |
-
$sidebar_id = ' id="' . $name . '"';
|
223 |
else :
|
224 |
$name = 'Widgets on Pages ' . $sidebar;
|
225 |
-
|
226 |
-
|
227 |
-
$id = 'wop_' . $sidebar;
|
228 |
$desc = '#' . $sidebar . 'Widgets on Pages sidebar.
|
229 |
Use shortcode
|
230 |
"[widgets_on_pages' . $sidebar_id .']"';
|
231 |
register_sidebar(array(
|
232 |
-
'name' => __( $name, 'wop' ),
|
|
|
233 |
'description' => __( $desc, 'wop' ),
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
));
|
239 |
}
|
240 |
endif;
|
241 |
}
|
242 |
|
243 |
-
|
244 |
register_activation_hook(__FILE__,'wop_install');
|
245 |
|
246 |
add_action('admin_init', 'reg_wop_sidebar');
|
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 or through the use of a template tag.
|
24 |
Author: Todd Halfpenny
|
25 |
+
Version: 0.0.8
|
26 |
Author URI: http://gingerbreaddesign.co.uk/todd
|
27 |
*/
|
28 |
|
40 |
}
|
41 |
|
42 |
|
43 |
+
add_filter('plugin_action_links', 'wop_plugin_action_links', 10, 2);
|
44 |
+
|
45 |
+
function wop_plugin_action_links($links, $file) {
|
46 |
+
static $this_plugin;
|
47 |
+
|
48 |
+
if (!$this_plugin) {
|
49 |
+
$this_plugin = plugin_basename(__FILE__);
|
50 |
+
}
|
51 |
+
|
52 |
+
if ($file == $this_plugin) {
|
53 |
+
$settings_link = '<a href="' . get_bloginfo('wpurl') . '/wp-admin/admin.php?page=wop_options">Settings</a>';
|
54 |
+
array_unshift($links, $settings_link);
|
55 |
+
}
|
56 |
+
|
57 |
+
return $links;
|
58 |
+
}
|
59 |
+
|
60 |
+
|
61 |
function register_wop_settings() { // whitelist options
|
62 |
register_setting( 'wop_options', 'wop_options_field' );
|
63 |
}
|
152 |
/* ===============================
|
153 |
C O N T E X T U A L H E L P
|
154 |
================================*/
|
155 |
+
function wop_contextual_help($text) {
|
156 |
$screen = $_GET['page'];
|
157 |
if ($screen == 'wop_options') {
|
158 |
$text = "<h5>Need help with the Widgets on Pages plugin?</h5>";
|
162 |
return $text;
|
163 |
}
|
164 |
|
165 |
+
add_action('contextual_help', 'wop_contextual_help', 10, 1);
|
166 |
|
167 |
|
168 |
/* ===============================
|
212 |
if ( function_exists('register_sidebar') )
|
213 |
if ($options['wop_name_1'] != "") :
|
214 |
$name = $options['wop_name_1'];
|
|
|
215 |
else :
|
216 |
$name = 'Widgets on Pages 1';
|
217 |
+
endif;
|
218 |
+
$sidebar_id = 'wop-1';
|
|
|
219 |
$desc = '#1 Widgets on Pages sidebar.
|
220 |
Use shortcode
|
221 |
"[widgets_on_pages' . $sidebar_id .']"';
|
222 |
register_sidebar(array(
|
223 |
+
'name' => __( $name, 'wop' ),
|
224 |
+
'id' => $sidebar_id ,
|
225 |
+
'description' => __( $desc, 'wop' ),
|
226 |
'before_widget' => '<li id="%1$s" class="widget %2$s">',
|
227 |
'after_widget' => '</li>',
|
228 |
'before_title' => '<h2 class="widgettitle">',
|
236 |
$option_id = 'wop_name_' . $sidebar;
|
237 |
if ($options[$option_id] != "") :
|
238 |
$name = $options[$option_id];
|
|
|
239 |
else :
|
240 |
$name = 'Widgets on Pages ' . $sidebar;
|
241 |
+
endif;
|
242 |
+
$sidebar_id = 'wop-' . $sidebar;
|
|
|
243 |
$desc = '#' . $sidebar . 'Widgets on Pages sidebar.
|
244 |
Use shortcode
|
245 |
"[widgets_on_pages' . $sidebar_id .']"';
|
246 |
register_sidebar(array(
|
247 |
+
'name' => __( $name, 'wop' ),
|
248 |
+
'id' => $sidebar_id ,
|
249 |
'description' => __( $desc, 'wop' ),
|
250 |
+
'before_widget' => '<li id="%1$s" class="widget %2$s">',
|
251 |
+
'after_widget' => '</li>',
|
252 |
+
'before_title' => '<h2 class="widgettitle">',
|
253 |
+
'after_title' => '</h2>',
|
254 |
));
|
255 |
}
|
256 |
endif;
|
257 |
}
|
258 |
|
|
|
259 |
register_activation_hook(__FILE__,'wop_install');
|
260 |
|
261 |
add_action('admin_init', 'reg_wop_sidebar');
|