{"id":18517,"date":"2012-06-11T05:07:33","date_gmt":"2012-06-11T05:07:33","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/widget-instance\/"},"modified":"2018-07-11T11:52:30","modified_gmt":"2018-07-11T11:52:30","slug":"widget-instance","status":"publish","type":"plugin","link":"https:\/\/cn.wordpress.org\/plugins\/widget-instance\/","author":8114201,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"0.9.4","stable_tag":"trunk","tested":"4.9.29","requires":"2.9.1","requires_php":"","requires_plugins":"","header_name":"Widget Instance","header_author":"Ben Cooling","header_description":"","assets_banners_color":"1b798d","last_updated":"2018-07-11 11:52:30","external_support_url":"","external_repository_url":"","donate_link":"http:\/\/bcooling.com.au","header_plugin_uri":"http:\/\/bcooling.com.au","header_author_uri":"http:\/\/bcooling.com.au","rating":3.4,"author_block_rating":0,"active_installs":500,"downloads":13304,"num_ratings":9,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":"3","2":0,"3":"1","4":0,"5":"5"},"assets_icons":{"icon-128x128.jpg":{"filename":"icon-128x128.jpg","revision":"1187239","resolution":"128x128","location":"assets"},"icon-256x256.jpg":{"filename":"icon-256x256.jpg","revision":"1187239","resolution":"256x256","location":"assets"}},"assets_banners":{"banner-1544x500.jpg":{"filename":"banner-1544x500.jpg","revision":"1187239","resolution":"1544x500","location":"assets"},"banner-772x250.jpg":{"filename":"banner-772x250.jpg","revision":"1187239","resolution":"772x250","location":"assets"}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":[],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":"1907620","resolution":"1","location":"plugin"},"screenshot-2.png":{"filename":"screenshot-2.png","revision":"1907620","resolution":"2","location":"plugin"}},"screenshots":{"1":"The Widget Instance editor button","2":"The editor dialog for inserting a specific widget instance"},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[65111,162,65140,241],"plugin_category":[43],"plugin_contributors":[82503],"plugin_business_model":[],"class_list":["post-18517","plugin","type-plugin","status-publish","hentry","plugin_tags-display-widget","plugin_tags-widget","plugin_tags-widget-instance","plugin_tags-widgets","plugin_category-customization","plugin_contributors-global_1981","plugin_committers-global_1981"],"banners":{"banner":"https:\/\/ps.w.org\/widget-instance\/assets\/banner-772x250.jpg?rev=1187239","banner_2x":"https:\/\/ps.w.org\/widget-instance\/assets\/banner-1544x500.jpg?rev=1187239","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/widget-instance\/assets\/icon-128x128.jpg?rev=1187239","icon_2x":"https:\/\/ps.w.org\/widget-instance\/assets\/icon-256x256.jpg?rev=1187239","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/widget-instance\/trunk\/screenshot-1.png?rev=1907620","caption":"The Widget Instance editor button"},{"src":"https:\/\/ps.w.org\/widget-instance\/trunk\/screenshot-2.png?rev=1907620","caption":"The editor dialog for inserting a specific widget instance"}],"raw_content":"<!--section=description-->\n<p>Widgets are normally displayed as part of a sidebar using the dynamic_sidebar()\nfunction. There is the_widget function for static widgets, but there is no\nequivalent for specific widgets configured in the Appearance &gt; Widgets area.<\/p>\n\n<p>The Widget Instance plugin allows Wordpress users of all abilities to display\nthese widgets outside of the sidebars they have been assigned to.<\/p>\n\nFeatures\n\n<ol>\n<li>A wysiwyg editor button for selecting available widgets,<\/li>\n<li>A shortcode [widget_instance id=\"[widget_id]\"],<\/li>\n<li>A theme action do_action('widget_instance', [widget_id]) and finally<\/li>\n<li>Utility functions for developers get_widget_instance and widget_instance<\/li>\n<\/ol>\n\nUsage\n\n<ul>\n<li>[widget_instance id=\"[widget_id]\"]<\/li>\n<li>do_action('widget_instance', '[widget_id]');<\/li>\n<li>the_widget_instance('[widget_id]');<\/li>\n<li>get_the_widget_instance('[widget_id]');<\/li>\n<\/ul>\n\n<!--section=installation-->\n<p>This section describes how to install the plugin and get it working.<\/p>\n\n<ol>\n<li>Upload <code>widget-instance<\/code> to the <code>\/wp-content\/plugins\/<\/code> directory<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress<\/li>\n<li>Within the editor, you can use the Widget Instance editor button to select\nfrom available widgets or enter a shortcode following the syntax: [widget_instance id=\"[widget_id]\"]<\/li>\n<li>Optional step: If you would like to retain the sidebar format of the widget, check the Include Sidebar format checkbox<\/li>\n<li>Within template files you can use the following php snippets:<\/li>\n<\/ol>\n\n<ul>\n<li>Action: do_action('widget_instance', '[widget_id]');<\/li>\n<li>Function: the_widget_instance('[widget_id]');<\/li>\n<li>Function: get_the_widget_instance('[widget_id]');<\/li>\n<\/ul>\n\n<!--section=faq-->\n<dl>\n<dt>How do I get the widget id?<\/dt>\n<dd><p>Of course the editor button automagically retrieves all the available widgets\n(and their ids) for you, but if you are using one of the PHP functions, you can\nget the available widget ids by looping over the array returned by the function\nwp_get_sidebars_widgets()<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>0.9.5<\/h4>\n\n<ul>\n<li>Tested in Wordpress 4.9.7<\/li>\n<\/ul>\n\n<h4>0.9.4<\/h4>\n\n<ul>\n<li>Included Imm\u00e1nuel Fodor's fix for empty dropdown<\/li>\n<\/ul>\n\n<h4>0.9.3<\/h4>\n\n<ul>\n<li>Tested in Wordpress 4.2.2, new banner, icons and tinymce button created.<\/li>\n<\/ul>\n\n<h4>0.9.2<\/h4>\n\n<ul>\n<li>Added javascript loader, fix for wordpress installs where wp-includes url is not in the root.<\/li>\n<\/ul>\n\n<h4>0.9.1<\/h4>\n\n<ul>\n<li>Can now select a widget by it's title as well as its id. The title is in parenthesis after the id.<\/li>\n<\/ul>\n\n<h4>0.9<\/h4>\n\n<ul>\n<li>Tested on 3.5.1<\/li>\n<li>Fixed php warnign typo<\/li>\n<\/ul>\n\n<h4>0.8<\/h4>\n\n<ul>\n<li>Tested on 3.4.1<\/li>\n<li>Added option for including sidebar formatting<\/li>\n<li>The widget's title will now include the sidebar title markup (More useful than having a plain text title)<\/li>\n<\/ul>\n\n<h4>0.5<\/h4>\n\n<ul>\n<li>Initial release<\/li>\n<\/ul>","raw_excerpt":"Display an active widget added to a sidebar within the editor or by using a shortcode, function or action.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/cn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/18517","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/cn.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/cn.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=18517"}],"author":[{"embeddable":true,"href":"https:\/\/cn.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/global_1981"}],"wp:attachment":[{"href":"https:\/\/cn.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=18517"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/cn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=18517"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/cn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=18517"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/cn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=18517"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/cn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=18517"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/cn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=18517"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}