Widgets: show instance in Rest API
This commit is contained in:
parent
84f8fcd016
commit
3e36432d94
|
@ -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'] ) ) {
|
||||
|
|
Loading…
Reference in New Issue