Version Description
- Resolve conflict with YouTube Lyte plugin (thanks to Massa P for the tip off)
- Can now add sidebars via template tags so extra sidebars can be added to themes very quickly.
- Added contextual help.
Download this release
Release Info
Developer | toddhalfpenny |
Plugin | Widgets on Pages |
Version | 0.0.7 |
Comparing to | |
See all releases |
Code changes from version 0.0.6 to 0.0.7
- readme.txt +16 -3
- widgets_on_pages.php +34 -8
readme.txt
CHANGED
@@ -3,10 +3,10 @@ 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.0.
|
7 |
-
Stable tag: 0.0.
|
8 |
|
9 |
-
Allows 'in-page' widget areas so widgets can be defined via shortcode straight into page/post content
|
10 |
|
11 |
== Description ==
|
12 |
|
@@ -26,10 +26,17 @@ Sidebars can also be named via the Widgets on Pages options page and that name c
|
|
26 |
1. Activate the plugin through the 'Plugins' menu in WordPress
|
27 |
1. Add the widgets you want to the `Widgets on Pages` widget area in the admin screens
|
28 |
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]`).
|
|
|
29 |
|
30 |
|
31 |
== Frequently Asked Questions ==
|
32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
= Can I have more than one defined sidebar area =
|
34 |
|
35 |
Yes... you can have an unlimited number of sidebars defined. The number available can be administered via the settings menu.
|
@@ -43,6 +50,12 @@ Yes... you can have an unlimited number of sidebars defined. The number availabl
|
|
43 |
|
44 |
== Changelog ==
|
45 |
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
= 0.0.6 =
|
47 |
|
48 |
Sidebars can now be named via the options page. These names can be used in place of the numerical id used in older versions. Note that if you change the name you will need to manually update any shortcodes where this is being used.
|
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.0.1
|
7 |
+
Stable tag: 0.0.7
|
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 |
|
11 |
== Description ==
|
12 |
|
26 |
1. Activate the plugin through the 'Plugins' menu in WordPress
|
27 |
1. Add the widgets you want to the `Widgets on Pages` widget area in the admin screens
|
28 |
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]`).
|
29 |
+
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"); ?>`
|
30 |
|
31 |
|
32 |
== Frequently Asked Questions ==
|
33 |
|
34 |
+
= How can I remove the bullet points which appear next to each widget?
|
35 |
+
|
36 |
+
This can be acheived using css. Please place the following in your theme's style sheet.
|
37 |
+
`div.widgets_on_page ul { list-style:none }`
|
38 |
+
|
39 |
+
|
40 |
= Can I have more than one defined sidebar area =
|
41 |
|
42 |
Yes... you can have an unlimited number of sidebars defined. The number available can be administered via the settings menu.
|
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)
|
56 |
+
1. Can now add sidebars via template tags so extra sidebars can be added to themes very quickly.
|
57 |
+
1. Added contextual help.
|
58 |
+
|
59 |
= 0.0.6 =
|
60 |
|
61 |
Sidebars can now be named via the options page. These names can be used in place of the numerical id used in older versions. Note that if you change the name you will need to manually update any shortcodes where this is being used.
|
widgets_on_pages.php
CHANGED
@@ -20,9 +20,9 @@
|
|
20 |
/*
|
21 |
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.
|
26 |
Author URI: http://gingerbreaddesign.co.uk/todd
|
27 |
*/
|
28 |
|
@@ -35,12 +35,12 @@ add_action('admin_menu', 'wop_menu');
|
|
35 |
|
36 |
function wop_menu() {
|
37 |
add_options_page('Widgets on Pages options', 'Widgets on Pages', 7, 'wop_options', 'wop_plugin_options');
|
38 |
-
add_action( 'admin_init', '
|
39 |
|
40 |
}
|
41 |
|
42 |
|
43 |
-
function
|
44 |
register_setting( 'wop_options', 'wop_options_field' );
|
45 |
}
|
46 |
|
@@ -129,13 +129,40 @@ function wop_install() {
|
|
129 |
update_option('wop_version', "0.0.6");
|
130 |
}
|
131 |
}
|
132 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
|
134 |
|
135 |
/* ===============================
|
136 |
C O R E C O D E
|
137 |
================================*/
|
138 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
|
140 |
function widgets_on_page($atts){
|
141 |
reg_wop_sidebar();
|
@@ -145,7 +172,7 @@ function widgets_on_page($atts){
|
|
145 |
else :
|
146 |
$sidebar_name = $id;
|
147 |
endif;
|
148 |
-
$str = "<div id='widgets_on_page'>
|
149 |
<ul>";
|
150 |
ob_start();
|
151 |
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar($sidebar_name) ) :
|
@@ -154,7 +181,7 @@ function widgets_on_page($atts){
|
|
154 |
ob_end_clean();
|
155 |
$str .= $myStr;
|
156 |
$str .= "</ul>
|
157 |
-
</div><!--
|
158 |
return $str;
|
159 |
}
|
160 |
|
@@ -219,5 +246,4 @@ register_activation_hook(__FILE__,'wop_install');
|
|
219 |
add_action('admin_init', 'reg_wop_sidebar');
|
220 |
add_shortcode('widgets_on_pages', 'widgets_on_page');
|
221 |
|
222 |
-
|
223 |
?>
|
20 |
/*
|
21 |
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.7
|
26 |
Author URI: http://gingerbreaddesign.co.uk/todd
|
27 |
*/
|
28 |
|
35 |
|
36 |
function wop_menu() {
|
37 |
add_options_page('Widgets on Pages options', 'Widgets on Pages', 7, 'wop_options', 'wop_plugin_options');
|
38 |
+
add_action( 'admin_init', 'register_wop_settings' );
|
39 |
|
40 |
}
|
41 |
|
42 |
|
43 |
+
function register_wop_settings() { // whitelist options
|
44 |
register_setting( 'wop_options', 'wop_options_field' );
|
45 |
}
|
46 |
|
129 |
update_option('wop_version', "0.0.6");
|
130 |
}
|
131 |
}
|
132 |
+
|
133 |
+
|
134 |
+
/* ===============================
|
135 |
+
C O N T E X T U A L H E L P
|
136 |
+
================================*/
|
137 |
+
function my_contextual_help($text) {
|
138 |
+
$screen = $_GET['page'];
|
139 |
+
if ($screen == 'wop_options') {
|
140 |
+
$text = "<h5>Need help with the Widgets on Pages plugin?</h5>";
|
141 |
+
$text .= "<p>Check out the documentation and support forums for help with this plugin.</p>";
|
142 |
+
$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>";
|
143 |
+
}
|
144 |
+
return $text;
|
145 |
+
}
|
146 |
+
|
147 |
+
add_action('contextual_help', 'my_contextual_help', 10, 1);
|
148 |
|
149 |
|
150 |
/* ===============================
|
151 |
C O R E C O D E
|
152 |
================================*/
|
153 |
|
154 |
+
// Main Function Code, to be included on themes
|
155 |
+
function widgets_on_template($id="") {
|
156 |
+
if (!empty($id)) {
|
157 |
+
$sidebar_name = $id;
|
158 |
+
}
|
159 |
+
else {
|
160 |
+
$sidebar_name = '1';
|
161 |
+
}
|
162 |
+
$arr = array(id => $sidebar_name );
|
163 |
+
echo widgets_on_page($arr);
|
164 |
+
}
|
165 |
+
|
166 |
|
167 |
function widgets_on_page($atts){
|
168 |
reg_wop_sidebar();
|
172 |
else :
|
173 |
$sidebar_name = $id;
|
174 |
endif;
|
175 |
+
$str = "<div id='" . str_replace(" ", "_", $sidebar_name) . "' class='widgets_on_page'>
|
176 |
<ul>";
|
177 |
ob_start();
|
178 |
if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar($sidebar_name) ) :
|
181 |
ob_end_clean();
|
182 |
$str .= $myStr;
|
183 |
$str .= "</ul>
|
184 |
+
</div><!-- widgets_on_page -->";
|
185 |
return $str;
|
186 |
}
|
187 |
|
246 |
add_action('admin_init', 'reg_wop_sidebar');
|
247 |
add_shortcode('widgets_on_pages', 'widgets_on_page');
|
248 |
|
|
|
249 |
?>
|