Making WordPress.org

Changeset 13961


Ignore:
Timestamp:
08/09/2024 07:54:25 PM (3 months ago)
Author:
ryelle
Message:

wporg-support-2024: Prevent search form submission when empty.

Fixes https://github.com/WordPress/wporg-documentation-2022/issues/64

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support-2024/searchform.php

    r13520 r13961  
    88    <label for="s" class="screen-reader-text"><?php _ex( 'Search for:', 'label', 'wporg-forums' ); ?></label>
    99    <input type="hidden" name="action" value="bbp-search-request" />
    10     <input type="search" id="s" class="search-field" placeholder="<?php echo esc_attr_x( 'Search forums', 'placeholder', 'wporg-forums' ); ?>" value="<?php echo esc_attr( bbp_get_search_terms() ); ?>" name="bbp_search" />
     10    <input type="search" id="s" class="search-field" placeholder="<?php echo esc_attr_x( 'Search forums', 'placeholder', 'wporg-forums' ); ?>" value="<?php echo esc_attr( bbp_get_search_terms() ); ?>" name="bbp_search" required />
    1111    <button class="button button-search">
    1212        <svg class="search-icon" viewBox="0 0 24 24" width="24" height="24">
     
    3535        }
    3636    ?>
    37     <input type="search" id="s" class="search-field" placeholder="<?php echo esc_attr( $placeholder ); ?>" value="<?php the_search_query(); ?>" name="s" />
     37    <input type="search" id="s" class="search-field" placeholder="<?php echo esc_attr( $placeholder ); ?>" value="<?php the_search_query(); ?>" name="s" required />
    3838    <?php if ( $project ) : ?>
    3939    <input type="hidden" name="intext" value="<?php echo esc_attr( $project->search_prefix ); ?>" />
Note: See TracChangeset for help on using the changeset viewer.