jetpack icon indicating copy to clipboard operation
jetpack copied to clipboard

Widget Visibility for Custom Post Type for Pages and Custom Taxonomies Concurrently

Open ntpixels opened this issue 11 years ago • 1 comments

A user got in touch wanting to add specific widget visibility rules. She wants it to follow both (a) a specific custom post type for pages and (b) two custom taxonomies. When all three rules are enabled, the widget only shows on the custom post type pages, not on the custom taxonomies.

Steps to Reproduce:

  1. Enable a theme with custom post type/add a custom post type
  2. Create a custom taxonomy or 2 for good measure.
  3. Add a widget.
  4. Create widget visibility rules for custom post type + taxonomy 1 + taxonomy 2

Expected result: The widget will appear only on the custom post type pages and custom taxonomies Actual: The widget only appears on the custom post type pages, unless the above code is added

She was able to create a workaround by adding the following condition to modules/widget-visibility/widget-conditions.php in function filter_widget, line 492:

else if ( is_tax($rule['minor']) )
$condition_result = true;

(potentially similar issue: https://github.com/Automattic/jetpack/issues/1627)

ntpixels avatar May 25 '15 19:05 ntpixels

Fixed in #6326

jeherve avatar Mar 07 '17 09:03 jeherve