Version Description
Download this release
Release Info
Developer | anmari |
Plugin | amr shortcode any widget |
Version | 4.0 |
Comparing to | |
See all releases |
Code changes from version 3.9 to 4.0
- amr-shortcode-any-widget.php +14 -7
- readme.txt +13 -13
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" ] [do_widget id=widgetnamedashed-n ]or include a whole widget area [do_widget_area]. Please see <a href="https://wordpress.org/plugins/amr-shortcode-any-widget/faq/">FAQ</a>.
|
6 |
Author: anmari
|
7 |
-
Version:
|
8 |
Author URI: http://webdesign.anmari.com
|
9 |
|
10 |
*/
|
@@ -12,12 +12,19 @@ Author URI: http://webdesign.anmari.com
|
|
12 |
|
13 |
add_action('in_widget_form', 'amr_spice_get_widget_id');
|
14 |
function amr_spice_get_widget_id($widget_instance) {
|
15 |
-
echo
|
16 |
-
if ($widget_instance->number=="__i__"){
|
17 |
-
echo "Save the widget first!</p>" ;
|
18 |
-
}
|
19 |
-
|
20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
}
|
22 |
|
23 |
function amr_remove_widget_class($params) { // remove the widget classes
|
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" ] [do_widget id=widgetnamedashed-n ]or include a whole widget area [do_widget_area]. Please see <a href="https://wordpress.org/plugins/amr-shortcode-any-widget/faq/">FAQ</a>.
|
6 |
Author: anmari
|
7 |
+
Version: 4.0
|
8 |
Author URI: http://webdesign.anmari.com
|
9 |
|
10 |
*/
|
12 |
|
13 |
add_action('in_widget_form', 'amr_spice_get_widget_id');
|
14 |
function amr_spice_get_widget_id($widget_instance) {
|
15 |
+
echo '<p><strong>As shortcode:</strong><br/>[do_widget "'.$widget_instance->name.'"]</p> ';
|
16 |
+
if ($widget_instance->number=="__i__") {
|
17 |
+
echo "<p>Save the widget first!</p>" ;
|
18 |
+
}
|
19 |
+
else { // somehow the new Widgets page breaks if we add this IF statement - WHY??
|
20 |
+
//if (is_plugin_active('classic-widgets/classic-widgets.php')) {
|
21 |
+
echo "or maybe with id [do_widget id=".$widget_instance->id. "] - incorrect unless Classic Widgets is active</p>";
|
22 |
+
//}
|
23 |
+
//else { */
|
24 |
+
//$widget_instance->name.
|
25 |
+
//echo '<p>[do_widget "name"] or activate Classic Widgets Plugin</p>';
|
26 |
+
//}
|
27 |
+
}
|
28 |
}
|
29 |
|
30 |
function amr_remove_widget_class($params) { // remove the widget classes
|
readme.txt
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
=== amr shortcode any widget ===
|
2 |
Contributors: anmari
|
3 |
Tags: shortcode, widget, page, templates, page template, widget_area, sidebar
|
4 |
-
Tested up to: 5.
|
5 |
-
Version:
|
6 |
-
Stable tag:
|
7 |
|
8 |
== Description ==
|
9 |
Insert a widget or multiple widgets or a entire widget area (sidebar) into a page using a shortcode.
|
@@ -91,7 +91,7 @@ Please get the widget working first in a normal sidebar without this plugin and
|
|
91 |
|
92 |
**How to identify widget**
|
93 |
|
94 |
-
To identify your widget in the shortcode, use the NAME or the ID.
|
95 |
|
96 |
The name is the generic NAME like "tag cloud".
|
97 |
|
@@ -162,6 +162,10 @@ If you only using widget, maybe inserting the whole sidebar or widgertarea would
|
|
162 |
[do_widget_area]
|
163 |
|
164 |
== Changelog ==
|
|
|
|
|
|
|
|
|
165 |
= Version 3.9 =
|
166 |
* Tiny tweak for php 8 compatibility in amr-utilities.php
|
167 |
* Tested on 5.7.2
|
@@ -281,13 +285,9 @@ If you only using widget, maybe inserting the whole sidebar or widgertarea would
|
|
281 |
|
282 |
== Screenshots ==
|
283 |
|
284 |
-
1.
|
285 |
-
2.
|
286 |
-
3.
|
287 |
-
|
288 |
-
|
289 |
-
5. The widget id is now visible in the widget window
|
290 |
-
6. After clicking on debug message - scroll down till you see the shortcodes sidebar - the widgets and their ids will be listed. Find the id of the widget you want.
|
291 |
-
7. Shortcode parameters to remove widget-classes in theme like the twenty-fourteen theme (avoid white text on white background)
|
292 |
-
8. Example of multiple rss widgets in twenty-fourteen theme
|
293 |
|
1 |
=== amr shortcode any widget ===
|
2 |
Contributors: anmari
|
3 |
Tags: shortcode, widget, page, templates, page template, widget_area, sidebar
|
4 |
+
Tested up to: 5.8
|
5 |
+
Version: 4.0
|
6 |
+
Stable tag: 4.0
|
7 |
|
8 |
== Description ==
|
9 |
Insert a widget or multiple widgets or a entire widget area (sidebar) into a page using a shortcode.
|
91 |
|
92 |
**How to identify widget**
|
93 |
|
94 |
+
To identify your widget in the shortcode, use the NAME or the ID. Please note that in wp 5.8 if you are not using the Classic Widgets plugin, the widgets page may show the incorrect widget id.
|
95 |
|
96 |
The name is the generic NAME like "tag cloud".
|
97 |
|
162 |
[do_widget_area]
|
163 |
|
164 |
== Changelog ==
|
165 |
+
= Version 4.0 =
|
166 |
+
* Tested on 5.8, NOTE you may need the Classic Widgets plugin as the new widgets page messes with the widget ids. Please see https://wordpress.org/support/topic/wp5-8-use-classic-widgets-plugin-with-this-plugin/
|
167 |
+
* Added text to show shortcode with widget name and highlight that without the classic widgets, the widget id may be incorrect. Eg: it' say meta-6, when it should be meta-1. Number difference is not always the same. You could also look at the widget settings in the database for the widget id.
|
168 |
+
|
169 |
= Version 3.9 =
|
170 |
* Tiny tweak for php 8 compatibility in amr-utilities.php
|
171 |
* Tested on 5.7.2
|
285 |
|
286 |
== Screenshots ==
|
287 |
|
288 |
+
1. meta widgets in a page
|
289 |
+
2. setting up widgets in the "widgets for shortcode" sidebar in the widgets page. The widget's user interface (UI) is used to provide a UI for the do_widget shortcode.
|
290 |
+
3. click on the widget in the widgets page to see the shortcode prompts
|
291 |
+
|
292 |
+
|
|
|
|
|
|
|
|
|
293 |
|