Widgets: show instance in Rest API

This commit is contained in:
Michael P. Pfeiffer 2021-05-31 12:20:57 +02:00
parent 84f8fcd016
commit 3e36432d94
1 changed files with 2 additions and 1 deletions

View File

@ -64,6 +64,7 @@ abstract class WC_Widget extends WP_Widget {
'classname' => $this->widget_cssclass,
'description' => $this->widget_description,
'customize_selective_refresh' => true,
'show_instance_in_rest' => true,
);
parent::__construct( $this->widget_id, $this->widget_name, $widget_ops );
@ -372,7 +373,7 @@ abstract class WC_Widget extends WP_Widget {
}
// All current filters.
if ( $_chosen_attributes = WC_Query::get_layered_nav_chosen_attributes() ) { // phpcs:ignore Squiz.PHP.DisallowMultipleAssignments.Found, WordPress.CodeAnalysis.AssignmentInCondition.Found
if ( $_chosen_attributes = WC_Query::get_layered_nav_chosen_attributes() ) { // phpcs:ignore Squiz.PHP.DisallowMultipleAssignments.FoundInControlStructure, WordPress.CodeAnalysis.AssignmentInCondition.Found
foreach ( $_chosen_attributes as $name => $data ) {
$filter_name = wc_attribute_taxonomy_slug( $name );
if ( ! empty( $data['terms'] ) ) {