amr shortcode any widget - Version 1.5

Version Description

Download this release

Release Info

Developer anmari
Plugin Icon wp plugin amr shortcode any widget
Version 1.5
Comparing to
See all releases

Code changes from version 1.4 to 1.5

Files changed (2) hide show
  1. amr_shortcode_any_widget.php +4 -4
  2. readme.txt +9 -2
amr_shortcode_any_widget.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: amr shortcode any widget
4
  Plugin URI: http://webdesign.anmari.com/shortcode-any-widget/
5
  Description: Include any widget in a page for any theme. [do_widget widgetname ] or [do_widget "widget name" ]. If upgrading see changelog. Can be very powerful eg: with queryposts widget it can bceome a templater.
6
  Author: anmari
7
- Version: 1.4
8
  Author URI: http://webdesign.anmari.com
9
 
10
  */
@@ -139,12 +139,12 @@ if it is in, then get the instance data and use that */
139
  }
140
 
141
  $output = '';
142
- if (empty ($wid)) {
143
  if ($debug) { echo '<h2>No Widget ids in sidebar '.$sidebarid.' with name '.$sidebar.' Try defaults </h2>';}
144
  unset($sidebar); unset($sidebarid);
145
 
146
  }
147
- else
148
  /* There may only be one but if we have two in our chosen widget then it will do both */
149
  $output = '';
150
  foreach ($wid as $i=>$widget_instance) {
@@ -153,7 +153,7 @@ if it is in, then get the instance data and use that */
153
  $output .= ob_get_clean();
154
  }
155
 
156
-
157
 
158
  return ($output);
159
  }
4
  Plugin URI: http://webdesign.anmari.com/shortcode-any-widget/
5
  Description: Include any widget in a page for any theme. [do_widget widgetname ] or [do_widget "widget name" ]. If upgrading see changelog. Can be very powerful eg: with queryposts widget it can bceome a templater.
6
  Author: anmari
7
+ Version: 1.5
8
  Author URI: http://webdesign.anmari.com
9
 
10
  */
139
  }
140
 
141
  $output = '';
142
+ if (empty ($wid) or (!is_array($wid)) or (count($wid) < 1)) {
143
  if ($debug) { echo '<h2>No Widget ids in sidebar '.$sidebarid.' with name '.$sidebar.' Try defaults </h2>';}
144
  unset($sidebar); unset($sidebarid);
145
 
146
  }
147
+ else {
148
  /* There may only be one but if we have two in our chosen widget then it will do both */
149
  $output = '';
150
  foreach ($wid as $i=>$widget_instance) {
153
  $output .= ob_get_clean();
154
  }
155
 
156
+ }
157
 
158
  return ($output);
159
  }
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Contributors: anmari
3
  Tags: shortcode, widget, page, templates, page template
4
  Tested up to: 3.3.1
5
- Version: 1.4
6
  Stable tag: trunk
7
 
8
  == Description ==
@@ -18,14 +18,21 @@ This simple 'utility' plugin allows one to have any widget used in a page shortc
18
  [do_widget "widget name"]. eg: [do_widget "tag cloud"]
19
  [do_widget id=widgetid] in a page or post
20
  7. If the plugin cannot work out what you want, it will show a debug prompt
21
- , click on the debug prompt and look for the id of your widget in the shortcodes sidebar (you may have to scroll through a lot of debug nfo). Try with the id. Sometimes the widget name that wordpress calls it internally is not the same as what you see on the screen and you willneed the 'debug' to find the id.
22
 
23
  Plugin has been tested with most standard widgets (rss feeds, tag cloud, pages, meta, search, and of course my own plugins widgets - upcoming events list, calendar and user lists.
24
 
25
  If you use a widget more than once for different reasons, you may need to use the widget id to isolate which widget instance and it's settings to use. ie: [do_widget id=categories-6] . If you just use the name, it will display all widgets in the shortcode sidebar with that name (all instances).
26
 
 
 
 
 
27
 
28
  == Changelog ==
 
 
 
29
  = Version 1.4 =
30
  * Updated readme - made very detailed steps and added some screen shots.
31
  * Tested on wp 3.3.1 and fixed some notices when bad parameters entered.
2
  Contributors: anmari
3
  Tags: shortcode, widget, page, templates, page template
4
  Tested up to: 3.3.1
5
+ Version: 1.5
6
  Stable tag: trunk
7
 
8
  == Description ==
18
  [do_widget "widget name"]. eg: [do_widget "tag cloud"]
19
  [do_widget id=widgetid] in a page or post
20
  7. If the plugin cannot work out what you want, it will show a debug prompt
21
+ , click on the debug prompt and look for the id of your widget in the shortcodes sidebar (you may have to scroll through a lot of debug nfo). Try with the id. Sometimes the widget name that wordpress calls it internally is not the same as what you see on the screen and you will need the 'debug' to find the id.
22
 
23
  Plugin has been tested with most standard widgets (rss feeds, tag cloud, pages, meta, search, and of course my own plugins widgets - upcoming events list, calendar and user lists.
24
 
25
  If you use a widget more than once for different reasons, you may need to use the widget id to isolate which widget instance and it's settings to use. ie: [do_widget id=categories-6] . If you just use the name, it will display all widgets in the shortcode sidebar with that name (all instances).
26
 
27
+ If you liked this plugin, you might also like my other plugins:
28
+ [icalevents.com](http://icalevents.com) - a ics compliant events plugin fully integrated with wordpress, so it will work with many other plugins (seo, maps, social)
29
+ [wpusersplugin.com](http://wpusersplugin.com) - a suite of plugins to help with membership sites. Major plugin is [amr users](http://wordpress.org/extend/plugins/amr-users/)
30
+
31
 
32
  == Changelog ==
33
+ = Version 1.5 =
34
+ * Fixed: a small bug which caused a warning if you had not saved the widgets in your shortcode sidebar
35
+
36
  = Version 1.4 =
37
  * Updated readme - made very detailed steps and added some screen shots.
38
  * Tested on wp 3.3.1 and fixed some notices when bad parameters entered.