Skip to content

Commit c5ceb41

Browse files
committed
Use selectors supports to show textarea
1 parent d493216 commit c5ceb41

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

html-api-debugger/html-api-integration.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
function get_supports(): array {
1313
return array(
1414
'create_fragment_advanced' => method_exists( WP_HTML_Processor::class, 'create_fragment_at_current_node' ),
15+
'selectors' =>
16+
class_exists( '\WP_CSS_Complex_Selector_List' )
17+
|| class_exists( '\WP_CSS_Compound_Selector_List' ),
1518
);
1619
}
1720

html-api-debugger/interactivity.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ class="context-html"
151151
<label>Show closers <input type="checkbox" data-wp-bind--checked="state.showClosers" data-wp-on-async--input="handleShowClosersClick"></label>
152152
<label>Show invisible <input type="checkbox" data-wp-bind--checked="state.showInvisible" data-wp-on-async--input="handleShowInvisibleClick"></label>
153153
<span><label>Show virtual <input type="checkbox" data-wp-bind--checked="state.showVirtual" data-wp-on-async--input="handleShowVirtualClick"></label></span>
154-
<div>
154+
<div data-wp-bind-hidden="!state.htmlapiResponse.supports.selectors">
155155
<label>CSS Selectors <textarea placeholder="CSS selector: .my-class" data-wp-on-async--input="handleSelectorChange"></textarea></label>
156156
</div>
157157
</div>

0 commit comments

Comments
 (0)