Version Description
- Added option to add CSS file to auto remove bullets... this has been the biggest cause of support mails/forum posts.
Download this release
Release Info
Developer | toddhalfpenny |
Plugin | Widgets on Pages |
Version | 0.0.10 |
Comparing to | |
See all releases |
Code changes from version 0.0.9 to 0.0.10
- readme.txt +9 -5
- widgets_on_pages.php +75 -56
- wop.css +1 -0
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.1
|
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 |
|
@@ -31,14 +31,14 @@ Sidebars can also be named via the Widgets on Pages options page and that name c
|
|
31 |
1. Add the widgets you want to the `Widgets on Pages` widget area in the admin screens
|
32 |
1. Add the shortcut `[widgets_on_pages id=x]` to the page or post in the place where you'd like your widgets to appear (where 'x' = the id of the sidebar to use (or the name if you have named it such as `[widgets_on_pages id=TagCloud]`). If using only the default sidebar then no 'id' argument is needed (i.e. `[widgets_on_pages]`).
|
33 |
1. To add a sidebar into a theme you can add the following type of code to the relevant PHP theme file. `<?php widgets_on_template("wop_1"); ?>`
|
|
|
34 |
|
35 |
|
36 |
== Frequently Asked Questions ==
|
37 |
|
38 |
= How can I remove the bullet points which appear next to each widget?
|
39 |
|
40 |
-
|
41 |
-
`div.widgets_on_page ul { list-style:none }`
|
42 |
|
43 |
|
44 |
= Can I have more than one defined sidebar area =
|
@@ -54,6 +54,10 @@ Yes... you can have an unlimited number of sidebars defined. The number availabl
|
|
54 |
|
55 |
== Changelog ==
|
56 |
|
|
|
|
|
|
|
|
|
57 |
= 0.0.9 =
|
58 |
|
59 |
1. Corrected shortcode tags show in Widget admin page.
|
@@ -68,7 +72,7 @@ Yes... you can have an unlimited number of sidebars defined. The number availabl
|
|
68 |
= 0.0.7 =
|
69 |
|
70 |
1. Resolve conflict with YouTube Lyte plugin (thanks to Massa P for the tip off)
|
71 |
-
1. Can now add sidebars via template tags so extra sidebars can be added to themes very quickly.
|
72 |
1. Added contextual help.
|
73 |
|
74 |
= 0.0.6 =
|
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.2.1
|
7 |
+
Stable tag: 0.0.10
|
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 |
|
31 |
1. Add the widgets you want to the `Widgets on Pages` widget area in the admin screens
|
32 |
1. Add the shortcut `[widgets_on_pages id=x]` to the page or post in the place where you'd like your widgets to appear (where 'x' = the id of the sidebar to use (or the name if you have named it such as `[widgets_on_pages id=TagCloud]`). If using only the default sidebar then no 'id' argument is needed (i.e. `[widgets_on_pages]`).
|
33 |
1. To add a sidebar into a theme you can add the following type of code to the relevant PHP theme file. `<?php widgets_on_template("wop_1"); ?>`
|
34 |
+
1. If you see bullet points/images next to the widget titles when using this plugin use the 'Enable Styling' setting in the options page
|
35 |
|
36 |
|
37 |
== Frequently Asked Questions ==
|
38 |
|
39 |
= How can I remove the bullet points which appear next to each widget?
|
40 |
|
41 |
+
Simply select the 'Enable Styling' setting in the Widgets on Pages options page.
|
|
|
42 |
|
43 |
|
44 |
= Can I have more than one defined sidebar area =
|
54 |
|
55 |
== Changelog ==
|
56 |
|
57 |
+
= 0.0.10 =
|
58 |
+
|
59 |
+
1. Added option to add CSS file to auto remove bullets... this has been the biggest cause of support mails/forum posts.
|
60 |
+
|
61 |
= 0.0.9 =
|
62 |
|
63 |
1. Corrected shortcode tags show in Widget admin page.
|
72 |
= 0.0.7 =
|
73 |
|
74 |
1. Resolve conflict with YouTube Lyte plugin (thanks to Massa P for the tip off)
|
75 |
+
1. Can now add sidebars via template tags so extra sidebars can be added to themes very quickly.
|
76 |
1. Added contextual help.
|
77 |
|
78 |
= 0.0.6 =
|
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 |
|
@@ -76,6 +76,7 @@ function wop_plugin_options() {
|
|
76 |
wp_nonce_field('update-options');
|
77 |
settings_fields( 'wop_options' );
|
78 |
$options = get_option('wop_options_field');
|
|
|
79 |
$num_add_sidebars = $options["num_of_wop_sidebars"];
|
80 |
?>
|
81 |
|
@@ -99,6 +100,15 @@ function wop_plugin_options() {
|
|
99 |
<table class="form-table">
|
100 |
|
101 |
<tr valign="top">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
<th scope="row">Number of additional sidebars</th>
|
103 |
<td><input type='text' name="wop_options_field[num_of_wop_sidebars]" size='3' value="<?php echo $num_add_sidebars;?>" onkeypress='validate(event)' /></td>
|
104 |
</tr>
|
@@ -138,30 +148,23 @@ function wop_plugin_options() {
|
|
138 |
================================*/
|
139 |
|
140 |
function wop_install() {
|
141 |
-
|
142 |
-
// older version sub run upgrade
|
143 |
-
$num_of_sidebars = get_option('num_of_wop_sidebars');
|
144 |
-
$wop_options = array(num_of_wop_sidebars => $num_of_sidebars);
|
145 |
-
update_option('wop_options_field', $wop_options);
|
146 |
-
delete_option('num_of_wop_sidebars');
|
147 |
-
update_option('wop_version', "0.0.6");
|
148 |
-
}
|
149 |
}
|
150 |
-
|
151 |
-
|
152 |
/* ===============================
|
153 |
C O N T E X T U A L H E L P
|
154 |
================================*/
|
155 |
-
function my_contextual_help($text) {
|
156 |
-
$screen = $_GET['page'];
|
157 |
-
if ($screen == 'wop_options') {
|
158 |
-
$text = "<h5>Need help with the Widgets on Pages plugin?</h5>";
|
159 |
-
$text .= "<p>Check out the documentation and support forums for help with this plugin.</p>";
|
160 |
-
$text .= "<a href=\"http://wordpress.org/extend/plugins/widgets-on-pages/installation/\">Documentation</a><br /><a href=\"http://wordpress.org/tags/widgets-on-pages?forum_id=10\">Support forums</a>";
|
161 |
-
}
|
162 |
-
return $text;
|
163 |
-
}
|
164 |
-
|
165 |
add_action('contextual_help', 'my_contextual_help', 10, 1);
|
166 |
|
167 |
|
@@ -169,18 +172,18 @@ add_action('contextual_help', 'my_contextual_help', 10, 1);
|
|
169 |
C O R E C O D E
|
170 |
================================*/
|
171 |
|
172 |
-
// Main Function Code, to be included on themes
|
173 |
-
function widgets_on_template($id="") {
|
174 |
-
if (!empty($id)) {
|
175 |
-
$sidebar_name = $id;
|
176 |
-
}
|
177 |
-
else {
|
178 |
-
$sidebar_name = '1';
|
179 |
-
}
|
180 |
-
$arr = array(id => $sidebar_name );
|
181 |
-
echo widgets_on_page($arr);
|
182 |
-
}
|
183 |
-
|
184 |
|
185 |
function widgets_on_page($atts){
|
186 |
reg_wop_sidebar();
|
@@ -192,8 +195,8 @@ function widgets_on_page($atts){
|
|
192 |
endif;
|
193 |
$str = "<div id='" . str_replace(" ", "_", $sidebar_name) . "' class='widgets_on_page'>
|
194 |
<ul>";
|
195 |
-
ob_start();
|
196 |
-
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar($sidebar_name) ) :
|
197 |
endif;
|
198 |
$myStr = ob_get_contents();
|
199 |
ob_end_clean();
|
@@ -218,18 +221,18 @@ function reg_wop_sidebar() {
|
|
218 |
$sidebar_id = "";
|
219 |
endif;
|
220 |
$id = 'wop-1';
|
221 |
-
//$sidebar_id = 'wop-1';
|
222 |
-
$desc = '#1 Widgets on Pages sidebar.
|
223 |
-
Use shortcode
|
224 |
-
"[widgets_on_pages' . $sidebar_id .']"';
|
225 |
register_sidebar(array(
|
226 |
'name' => __( $name, 'wop' ),
|
227 |
-
'id' => $id ,
|
228 |
-
'description' => __( $desc, 'wop' ),
|
229 |
-
'before_widget' => '<li id="%1$s" class="widget %2$s">',
|
230 |
-
'after_widget' => '</li>',
|
231 |
-
'before_title' => '<h2 class="widgettitle">',
|
232 |
-
'after_title' => '</h2>',
|
233 |
));
|
234 |
|
235 |
// register any other additional sidebars
|
@@ -245,18 +248,18 @@ register_sidebar(array(
|
|
245 |
$sidebar_id = ' id=' . $sidebar;
|
246 |
endif;
|
247 |
//$sidebar_id = 'wop-' . $sidebar;
|
248 |
-
$id = 'wop-' . $sidebar;
|
249 |
-
$desc = '#' . $sidebar . 'Widgets on Pages sidebar.
|
250 |
-
Use shortcode
|
251 |
-
"[widgets_on_pages' . $sidebar_id .']"';
|
252 |
-
register_sidebar(array(
|
253 |
'name' => __( $name, 'wop' ),
|
254 |
-
'id' => $id ,
|
255 |
-
'description' => __( $desc, 'wop' ),
|
256 |
-
'before_widget' => '<li id="%1$s" class="widget %2$s">',
|
257 |
-
'after_widget' => '</li>',
|
258 |
-
'before_title' => '<h2 class="widgettitle">',
|
259 |
-
'after_title' => '</h2>',
|
260 |
));
|
261 |
}
|
262 |
endif;
|
@@ -268,4 +271,20 @@ register_activation_hook(__FILE__,'wop_install');
|
|
268 |
add_action('admin_init', 'reg_wop_sidebar');
|
269 |
add_shortcode('widgets_on_pages', 'widgets_on_page');
|
270 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
271 |
?>
|
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.10
|
26 |
Author URI: http://gingerbreaddesign.co.uk/todd
|
27 |
*/
|
28 |
|
76 |
wp_nonce_field('update-options');
|
77 |
settings_fields( 'wop_options' );
|
78 |
$options = get_option('wop_options_field');
|
79 |
+
$enable_css = $options["enable_css"];
|
80 |
$num_add_sidebars = $options["num_of_wop_sidebars"];
|
81 |
?>
|
82 |
|
100 |
<table class="form-table">
|
101 |
|
102 |
<tr valign="top">
|
103 |
+
<th scope="row">Enable styling (remove bullets etc)</th>
|
104 |
+
<td>
|
105 |
+
<? echo '<input name="wop_options_field[enable_css]" type="checkbox" value="1" class="code" ' . checked( 1, $enable_css, false ) . ' />';
|
106 |
+
?>
|
107 |
+
</td>
|
108 |
+
</tr>
|
109 |
+
|
110 |
+
|
111 |
+
<tr valign="top">
|
112 |
<th scope="row">Number of additional sidebars</th>
|
113 |
<td><input type='text' name="wop_options_field[num_of_wop_sidebars]" size='3' value="<?php echo $num_add_sidebars;?>" onkeypress='validate(event)' /></td>
|
114 |
</tr>
|
148 |
================================*/
|
149 |
|
150 |
function wop_install() {
|
151 |
+
// nothing to do this time out
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
152 |
}
|
153 |
+
|
154 |
+
|
155 |
/* ===============================
|
156 |
C O N T E X T U A L H E L P
|
157 |
================================*/
|
158 |
+
function my_contextual_help($text) {
|
159 |
+
$screen = $_GET['page'];
|
160 |
+
if ($screen == 'wop_options') {
|
161 |
+
$text = "<h5>Need help with the Widgets on Pages plugin?</h5>";
|
162 |
+
$text .= "<p>Check out the documentation and support forums for help with this plugin.</p>";
|
163 |
+
$text .= "<a href=\"http://wordpress.org/extend/plugins/widgets-on-pages/installation/\">Documentation</a><br /><a href=\"http://wordpress.org/tags/widgets-on-pages?forum_id=10\">Support forums</a>";
|
164 |
+
}
|
165 |
+
return $text;
|
166 |
+
}
|
167 |
+
|
168 |
add_action('contextual_help', 'my_contextual_help', 10, 1);
|
169 |
|
170 |
|
172 |
C O R E C O D E
|
173 |
================================*/
|
174 |
|
175 |
+
// Main Function Code, to be included on themes
|
176 |
+
function widgets_on_template($id="") {
|
177 |
+
if (!empty($id)) {
|
178 |
+
$sidebar_name = $id;
|
179 |
+
}
|
180 |
+
else {
|
181 |
+
$sidebar_name = '1';
|
182 |
+
}
|
183 |
+
$arr = array(id => $sidebar_name );
|
184 |
+
echo widgets_on_page($arr);
|
185 |
+
}
|
186 |
+
|
187 |
|
188 |
function widgets_on_page($atts){
|
189 |
reg_wop_sidebar();
|
195 |
endif;
|
196 |
$str = "<div id='" . str_replace(" ", "_", $sidebar_name) . "' class='widgets_on_page'>
|
197 |
<ul>";
|
198 |
+
ob_start();
|
199 |
+
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar($sidebar_name) ) :
|
200 |
endif;
|
201 |
$myStr = ob_get_contents();
|
202 |
ob_end_clean();
|
221 |
$sidebar_id = "";
|
222 |
endif;
|
223 |
$id = 'wop-1';
|
224 |
+
//$sidebar_id = 'wop-1';
|
225 |
+
$desc = '#1 Widgets on Pages sidebar.
|
226 |
+
Use shortcode
|
227 |
+
"[widgets_on_pages' . $sidebar_id .']"';
|
228 |
register_sidebar(array(
|
229 |
'name' => __( $name, 'wop' ),
|
230 |
+
'id' => $id ,
|
231 |
+
'description' => __( $desc, 'wop' ),
|
232 |
+
'before_widget' => '<li id="%1$s" class="widget %2$s">',
|
233 |
+
'after_widget' => '</li>',
|
234 |
+
'before_title' => '<h2 class="widgettitle">',
|
235 |
+
'after_title' => '</h2>',
|
236 |
));
|
237 |
|
238 |
// register any other additional sidebars
|
248 |
$sidebar_id = ' id=' . $sidebar;
|
249 |
endif;
|
250 |
//$sidebar_id = 'wop-' . $sidebar;
|
251 |
+
$id = 'wop-' . $sidebar;
|
252 |
+
$desc = '#' . $sidebar . 'Widgets on Pages sidebar.
|
253 |
+
Use shortcode
|
254 |
+
"[widgets_on_pages' . $sidebar_id .']"';
|
255 |
+
register_sidebar(array(
|
256 |
'name' => __( $name, 'wop' ),
|
257 |
+
'id' => $id ,
|
258 |
+
'description' => __( $desc, 'wop' ),
|
259 |
+
'before_widget' => '<li id="%1$s" class="widget %2$s">',
|
260 |
+
'after_widget' => '</li>',
|
261 |
+
'before_title' => '<h2 class="widgettitle">',
|
262 |
+
'after_title' => '</h2>',
|
263 |
));
|
264 |
}
|
265 |
endif;
|
271 |
add_action('admin_init', 'reg_wop_sidebar');
|
272 |
add_shortcode('widgets_on_pages', 'widgets_on_page');
|
273 |
|
274 |
+
|
275 |
+
/* ===============================
|
276 |
+
A D D C S S ?
|
277 |
+
================================*/
|
278 |
+
function add_wop_css_to_head()
|
279 |
+
{
|
280 |
+
echo "<link rel='stylesheet' id='wop-css' href='".get_settings('siteurl')."/wp-content/plugins/widgets-on-pages/wop.css' type='text/css' media='all' />";
|
281 |
+
}
|
282 |
+
|
283 |
+
$options = get_option('wop_options_field');
|
284 |
+
$enable_css = $options["enable_css"];
|
285 |
+
if ($enable_css) {
|
286 |
+
add_action('wp_head', 'add_wop_css_to_head');
|
287 |
+
}
|
288 |
+
|
289 |
+
|
290 |
?>
|
wop.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.widgets_on_page ul {list-style:none;background:none;}
|