amr shortcode any widget - Version 2.1

Version Description

Download this release

Release Info

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

Code changes from version 2.0 to 2.1

Files changed (2) hide show
  1. amr-shortcode-any-widget.php +5 -6
  2. readme.txt +8 -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" ] or include a whole widget area [do_widget_area]. If upgrading see changelog. Can be very powerful eg: with queryposts widget it can become a templater.
6
  Author: anmari
7
- Version: 2.0
8
  Author URI: http://webdesign.anmari.com
9
 
10
  */
@@ -44,7 +44,6 @@ if it is in, then get the instance data and use that */
44
  }
45
 
46
  extract(shortcode_atts(array(
47
- // 'sidebar' => 'Shortcodes',
48
  'sidebar' => 'Widgets for Shortcodes',
49
  'id' => '',
50
  'name' => '', /* MKM added explicit 'name' attribute. For existing users we still need to allow prev method, else too many support queries will happen */
@@ -252,7 +251,7 @@ if ( function_exists('register_sidebar') ) { // maybe later, get the first mai
252
 
253
 
254
  if (!empty($wp_registered_sidebars)) { // we got some sidebars already.
255
- $main_sidebar = array_pop($wp_registered_sidebars); // Grab the first sidebar and use that as defaults for the widgets
256
  $args['before_widget'] = $main_sidebar['before_widget'];
257
  $args['after_widget'] = $main_sidebar['after_widget'];
258
  $args['before_title'] = $main_sidebar['before_title'];
@@ -271,9 +270,9 @@ include ('amr-utilities.php');
271
  if (is_admin() ) $amr_saw_plugin_admin = new amr_saw_plugin_admin();
272
 
273
  add_action('widgets_init', 'amr_reg_sidebar',98); // register late so it appears last
274
- add_action('widgets_init', 'amr_upgrade_sidebar',99); // copy old shortcodes sidebar to new one if necessary
275
- add_action('switch_theme', 'amr_save_shortcodes_sidebar');
276
- add_action('after_switch_theme','amr_restore_shortcodes_sidebar');
277
 
278
  add_shortcode('do_widget', 'do_widget');
279
  add_shortcode('do_widget_area', 'do_widget_area'); // just dump the whole widget area - to get same styling
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" ] or include a whole widget area [do_widget_area]. If upgrading see changelog. Can be very powerful eg: with queryposts widget it can become a templater.
6
  Author: anmari
7
+ Version: 2.1
8
  Author URI: http://webdesign.anmari.com
9
 
10
  */
44
  }
45
 
46
  extract(shortcode_atts(array(
 
47
  'sidebar' => 'Widgets for Shortcodes',
48
  'id' => '',
49
  'name' => '', /* MKM added explicit 'name' attribute. For existing users we still need to allow prev method, else too many support queries will happen */
251
 
252
 
253
  if (!empty($wp_registered_sidebars)) { // we got some sidebars already.
254
+ $main_sidebar = reset($wp_registered_sidebars); // Grab the first sidebar and use that as defaults for the widgets
255
  $args['before_widget'] = $main_sidebar['before_widget'];
256
  $args['after_widget'] = $main_sidebar['after_widget'];
257
  $args['before_title'] = $main_sidebar['before_title'];
270
  if (is_admin() ) $amr_saw_plugin_admin = new amr_saw_plugin_admin();
271
 
272
  add_action('widgets_init', 'amr_reg_sidebar',98); // register late so it appears last
273
+ //add_action('widgets_init', 'amr_upgrade_sidebar',99); // copy old shortcodes sidebar to new one if necessary
274
+ //add_action('switch_theme', 'amr_save_shortcodes_sidebar');
275
+ //add_action('after_switch_theme','amr_restore_shortcodes_sidebar');
276
 
277
  add_shortcode('do_widget', 'do_widget');
278
  add_shortcode('do_widget_area', 'do_widget_area'); // just dump the whole widget area - to get same styling
readme.txt CHANGED
@@ -2,11 +2,13 @@
2
  Contributors: anmari
3
  Tags: shortcode, widget, page, templates, page template
4
  Tested up to: 3.8.1
5
- Version: 2
6
  Stable tag: trunk
7
 
8
  == Description ==
9
- This simple 'utility' plugin allows one to have any widget used in a page shortcode in any theme - no need to use the hybrid theme or create a special template. You could use the query posts widget in the page to create a archive within a page, or the rss widget to list feed content from other sites. For more details see [anmari.com](http://webdesign.anmari.com/category/plugins/shortcode-any-widget/)
 
 
10
 
11
  1. Test your chosen widget works in a normal sidebar or widget area first.
12
  2. Then Activate this plugin
@@ -39,6 +41,10 @@ If you liked this plugin, you might also like my other plugins:
39
 
40
 
41
  == Changelog ==
 
 
 
 
42
  = Version 2 =
43
  * Shortcode widget id changed so that wordpress will save the shortcode settings per theme.
44
  * Added Code to auto upgrade, but just in case please check your widgets page. Look at the inactive widgets if the widgets are not in your widgets for shortcodes sidebar.
2
  Contributors: anmari
3
  Tags: shortcode, widget, page, templates, page template
4
  Tested up to: 3.8.1
5
+ Version: 2.1
6
  Stable tag: trunk
7
 
8
  == Description ==
9
+ Insert widgets or a widget area into a page. Works by creating an extra sidebar/widget area that you can use to store the widgets settings. Plugin will then call that widget instance from the do_widget shortcode, or that sidebar from the do_wdget_area shortcode.
10
+ You could use the query posts widget in the page to create a archive within a page, or the rss widget to list feed content from other sites.
11
+ For more details see [anmari.com](http://webdesign.anmari.com/category/plugins/shortcode-any-widget/)
12
 
13
  1. Test your chosen widget works in a normal sidebar or widget area first.
14
  2. Then Activate this plugin
41
 
42
 
43
  == Changelog ==
44
+ = Version 2.1 =
45
+ * Bug Fix - last sidebar registered by theme was being overwritten by the attempt to copy the themes sidebar arguments so that cleverly (hopefully) the shortcode widgets would pick up the same styling. Fixed now. Now it really does pickup the first sidebars styling - with devasting consquence in twenty-fourteen theme - yes white text on white background is not fun to read. But on other themes it works a treat.
46
+
47
+
48
  = Version 2 =
49
  * Shortcode widget id changed so that wordpress will save the shortcode settings per theme.
50
  * Added Code to auto upgrade, but just in case please check your widgets page. Look at the inactive widgets if the widgets are not in your widgets for shortcodes sidebar.