Skip to content

Commit

Permalink
Avoid the use of IDs to associate labels with forum search field.
Browse files Browse the repository at this point in the history
We have more than one instance of form-search on a page, resulting
in multiple instances of the same ID. This is invalid HTML and causes
errors in WAVE.

See #3269.
  • Loading branch information
boonebgorges committed Nov 2, 2023
1 parent 3e322c6 commit c88bb37
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions wp-content/themes/openlab/bbpress/form-search.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
<div class="bbp-search-form">
<form role="search" method="get" id="bbp-search-form" action="<?php echo esc_url( bp_get_group_permalink( groups_get_current_group() ) ); ?>forum/">
<div>
<label class="screen-reader-text hidden" for="bbp_search"><?php esc_html_e( 'Search for:', 'bbpress' ); ?></label>
<input type="text" value="<?php bbp_search_terms(); ?>" name="bbp_search" id="bbp_search" />
<label>
<span class="screen-reader-text"><?php esc_html_e( 'Search for:', 'bbpress' ); ?></span>
<input type="text" value="<?php bbp_search_terms(); ?>" name="bbp_search" id="bbp_search" />
</label>
<input class="button" type="submit" id="bbp_search_submit" value="<?php esc_attr_e( 'Search', 'bbpress' ); ?>" />
</div>
</form>
Expand Down

0 comments on commit c88bb37

Please sign in to comment.