Skip to content

Commit

Permalink
Search Block: remove id attribute from svg (#40828)
Browse files Browse the repository at this point in the history
* add a static variable `index` to make HTML id attribute unique search block

* use `wp_unique_id` and `esc_attr` to generate unique id

* remove `id=search-icon` svg for search block
  • Loading branch information
amustaque97 committed May 6, 2022
1 parent df8647c commit 7aeaae5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/block-library/src/search/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function render_block_core_search( $attributes ) {
$button_classes .= ' has-icon';

$button_internal_markup =
'<svg id="search-icon" class="search-icon" viewBox="0 0 24 24" width="24" height="24">
'<svg class="search-icon" viewBox="0 0 24 24" width="24" height="24">
<path d="M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z"></path>
</svg>';
}
Expand Down

0 comments on commit 7aeaae5

Please sign in to comment.