Widget Visibility for Custom Post Type for Pages and Custom Taxonomies Concurrently
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:
- Enable a theme with custom post type/add a custom post type
- Create a custom taxonomy or 2 for good measure.
- Add a widget.
- 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)
Fixed in #6326