{"id":1361,"date":"2011-03-28T14:20:40","date_gmt":"2011-03-28T14:20:40","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/conditional-widgets\/"},"modified":"2025-02-13T20:54:18","modified_gmt":"2025-02-13T20:54:18","slug":"conditional-widgets","status":"publish","type":"plugin","link":"https:\/\/fr.wordpress.org\/plugins\/conditional-widgets\/","author":5595601,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"3.3","stable_tag":"trunk","tested":"6.7.5","requires":"3.0","requires_php":"","requires_plugins":null,"header_name":"Conditional Widgets","header_author":"Jason LeMahieu and Kevin Graeme","header_description":"","assets_banners_color":"d1d1d1","last_updated":"2025-02-13 20:54:18","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"http:\/\/wordpress.org\/extend\/plugins\/conditional-widgets\/","header_author_uri":"","rating":4.5,"author_block_rating":0,"active_installs":7000,"downloads":138836,"num_ratings":24,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.0.1":{"tag":"1.0.1","author":"MadtownLems","date":"2011-03-28 20:47:25"},"1.0.3":{"tag":"1.0.3","author":"MadtownLems","date":"2011-07-19 17:09:01"},"1.1":{"tag":"1.1","author":"MadtownLems","date":"2011-07-26 19:28:46"},"1.2":{"tag":"1.2","author":"MadtownLems","date":"2011-08-18 21:23:28"},"1.4":{"tag":"1.4","author":"MadtownLems","date":"2011-08-24 14:36:50"},"1.5":{"tag":"1.5","author":"MadtownLems","date":"2012-02-28 18:41:24"},"1.6":{"tag":"1.6","author":"MadtownLems","date":"2013-09-05 13:53:57"},"1.7":{"tag":"1.7","author":"MadtownLems","date":"2014-04-18 19:08:47"},"1.8":{"tag":"1.8","author":"MadtownLems","date":"2014-05-30 13:30:33"},"2.0.4":{"tag":"2.0.4","author":"MadtownLems","date":"2014-09-11 13:50:04"},"2.1":{"tag":"2.1","author":"MadtownLems","date":"2015-04-28 19:35:31"},"2.2":{"tag":"2.2","author":"MadtownLems","date":"2015-05-01 21:47:41"},"3":{"tag":"3","author":"MadtownLems","date":"2021-03-02 15:12:58"}},"upgrade_notice":[],"ratings":{"1":"1","2":"1","3":"2","4":0,"5":"20"},"assets_icons":[],"assets_banners":{"banner-772x250.jpg":{"filename":"banner-772x250.jpg","revision":741054,"resolution":"772x250","location":"assets","locale":""}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":null,"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":3240334,"resolution":"1","location":"plugin"}},"screenshots":{"1":"Each widget gets an expandable form at the bottom of it for controlling display options on the home page and for both pages and categories."},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[241],"plugin_category":[43],"plugin_contributors":[79097,79096],"plugin_business_model":[],"class_list":["post-1361","plugin","type-plugin","status-publish","hentry","plugin_tags-widgets","plugin_category-customization","plugin_contributors-kgraeme","plugin_contributors-madtownlems","plugin_committers-madtownlems"],"banners":{"banner":"https:\/\/ps.w.org\/conditional-widgets\/assets\/banner-772x250.jpg?rev=741054","banner_2x":false,"banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/conditional-widgets_d1d1d1.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/conditional-widgets\/trunk\/screenshot-1.png?rev=3240334","caption":"Each widget gets an expandable form at the bottom of it for controlling display options on the home page and for both pages and categories."}],"raw_content":"<!--section=description-->\n<p>IMPORTANT: This plugin will NOT function after the Widgets screen overhaul that is part of WordPress 5.8 unless you use the Classic Widgets plugin (https:\/\/wordpress.org\/plugins\/classic-widgets\/). The plugin will continue to be supported\/maintained for those using Classic Widgets, but there are no plans to make Conditional Widgets work once Widgets are Blocks.<\/p>\n\n<p>This plugin adds a form to each widget on the Widgets panel which allows users to choose which pages and\/or categories the widget is either displayed on or hidden from.<\/p>\n\n<p>For each widget, you can choose criteria to either SHOW or HIDE the widget, based on a number of categories.  The interface is quite intuitive, and requires no knowledge of php or conditional tags.<\/p>\n\n<!--section=installation-->\n<p>Standard Installation Procedure<\/p>\n\n<ol>\n<li>Upload the <code>cets-conditional-widgets<\/code> folder to the <code>\/wp-content\/plugins\/<\/code> directory<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id='can%20i%20use%20it%20with%20custom%20post%20types%20or%20taxonomies%3F'><h3>Can I Use it with Custom Post Types or Taxonomies?<\/h3><\/dt>\n<dd><p>Yes and No.<\/p>\n\n<p>Conditional Widgets can be configured with additional Type\/Taxonomy pairs (both native and custom), similar to how it functions with Posts and Categories. However, it does not support additional Custom Post Types the way it does Pages. (If I were going to write it from scratch, I would have definitely included that, but have no plans to add it given that Widgets themselves are on the way to becoming unsupported.)<\/p>\n\n<p>The following filter is available to take pairs of Post Type and Taxononmy slugs (use in functions.php or a small plugin):<\/p>\n\n<pre>\n\/\/ Add Conditional Widgets support for Success Stories (Post Type) &amp; Story Groups (Taxonomy)\nadd_filter('conditional_widgets_type_tax_pairs', 'success_story_conditional_widget_type_tax_pairs' );\n\nfunction success_story_conditional_widget_type_tax_pairs( $pairs_array ) {\n\n    $success_story_pair = array(\n        'type'=&gt; 'success-story',\n        'tax'=&gt; 'story-group' \n    );\n\n    $pairs_array[] = $success_story_pair;\n    return $pairs_array;\n\n}\n<\/pre>\n\n<p>If you really want to be able to use Conditional Widgets to control Widget display on individual instances of a Custom Post Type (rather than based on a Taxonomy), the workaround would be to create unique Taxonomy terms for those Custom Posts.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>3.3<\/h4>\n\n<pre><code>    Updated tested to version, documented support for custom post type and taxonomy support\n<\/code><\/pre>\n\n<h4>3.2<\/h4>\n\n<ul>\n<li>Tested through version 6.5.5<\/li>\n<\/ul>\n\n<h4>3.1<\/h4>\n\n<ul>\n<li>Added message to readme explaining the future of Conditional widgets after WordPress 5.8<\/li>\n<\/ul>\n\n<h4>3<\/h4>\n\n<ul>\n<li>Improved string translatability (Props @alexclassroom)<\/li>\n<\/ul>\n\n<h4>2.2<\/h4>\n\n<ul>\n<li>New Features: Hide on Desktop \/ Hide on Mobile.  (Note that using either of these options will immediately hide the widget when the condition is true, and any other options to 'show' will be ignored.<\/li>\n<li>Fixes lots of small bugs related to the display of the widget control form<\/li>\n<\/ul>\n\n<h4>2.1<\/h4>\n\n<ul>\n<li>Major update of code formatting to better align with WordPress style and guidelines - props @cFoellmann<\/li>\n<li>Support Conditional Widgets toggle JavaScript on the Customize screen<\/li>\n<\/ul>\n\n<h4>2.0.5<\/h4>\n\n<ul>\n<li>Attempted to resolve the strict warnings<\/li>\n<li>IMPORTANT! If updating in a MultiSite\/Network environment, you'll need to visit the dashboard of every site for the plugin to continue to work properly.  If you have a large network, consider using my helper plugin: <a href='https:\/\/github.com\/MadtownLems\/cets-multisite-dashboard-crawler'>https:\/\/github.com\/MadtownLems\/cets-multisite-dashboard-crawler<\/a><\/li>\n<\/ul>\n\n<h4>2.0.1<\/h4>\n\n<ul>\n<li>Major Rewrite: modified how settings are stored.<\/li>\n<\/ul>\n\n<h4>1.8<\/h4>\n\n<ul>\n<li>Added an additional checkbox for ALL pages\/categories to, once again, make the UI even easier to understand<\/li>\n<\/ul>\n\n<h4>1.7<\/h4>\n\n<ul>\n<li>Added VERY basic string translation support<\/li>\n<li>Tweaked UI surrounding pages\/categories to be easier to understand<\/li>\n<\/ul>\n\n<h4>1.6<\/h4>\n\n<ul>\n<li>Only display the informative debugging text when WP_DEBUG_DISPLAY is true<\/li>\n<li>More verbose informative debugging text<\/li>\n<\/ul>\n\n<h4>1.5<\/h4>\n\n<ul>\n<li>Fixed a bug surrounding the extra conditional checks on some configurations (Thanks, mmcginnis!)<\/li>\n<li>Added debugging and informative statements while WP_DEBUG is enabled<\/li>\n<\/ul>\n\n<h4>1.4<\/h4>\n\n<ul>\n<li>Added support for Posts Pages (when using Static Front Page)<\/li>\n<\/ul>\n\n<h4>1.3<\/h4>\n\n<ul>\n<li>Added support for saving options on Widgets that didn't otherwise have options<\/li>\n<\/ul>\n\n<h4>1.2<\/h4>\n\n<ul>\n<li>Added option for Tag Archives (by request)<\/li>\n<\/ul>\n\n<h4>1.1<\/h4>\n\n<ul>\n<li>Added options for Search, 404, Date Archives, and Author Archives<\/li>\n<\/ul>\n\n<h4>1.0.2<\/h4>\n\n<ul>\n<li>Small edit to play nicely with some other plugins and their additional processing<\/li>\n<\/ul>\n\n<h4>1.0.1<\/h4>\n\n<ul>\n<li>Basic bug fixes: resolved some warnings and errors. (Sorry for the inconvenience.)<\/li>\n<\/ul>\n\n<h4>1.0<\/h4>\n\n<ul>\n<li>Initial Release<\/li>\n<\/ul>","raw_excerpt":"Easily control the display of widgets based on pages or categories","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/fr.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/1361","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fr.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/fr.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/fr.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=1361"}],"author":[{"embeddable":true,"href":"https:\/\/fr.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/madtownlems"}],"wp:attachment":[{"href":"https:\/\/fr.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=1361"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/fr.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=1361"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/fr.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=1361"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/fr.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=1361"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/fr.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=1361"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/fr.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=1361"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}