Skip to content

Commit

Permalink
add required attribute for to search block so empty searches aren't s…
Browse files Browse the repository at this point in the history
…ubmitted (#18635)
  • Loading branch information
skorasaurus authored and gziolo committed Jan 8, 2020
1 parent 7c2b50c commit 5ee7986
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 @@ -34,7 +34,7 @@ function render_block_core_search( $attributes ) {
}

$input_markup = sprintf(
'<input type="search" id="%s" class="wp-block-search__input" name="s" value="%s" placeholder="%s" />',
'<input type="search" id="%s" class="wp-block-search__input" name="s" value="%s" placeholder="%s" required />',
$input_id,
esc_attr( get_search_query() ),
esc_attr( $attributes['placeholder'] )
Expand Down

0 comments on commit 5ee7986

Please sign in to comment.