-
Notifications
You must be signed in to change notification settings - Fork 1
/
searchform.php
26 lines (22 loc) · 1.14 KB
/
searchform.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
/**
* The template for displaying search forms
*
* @package Wssbase
*/
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
$uid = wp_unique_id( 's-' ); // The search form specific unique ID for the input.
$aria_label = '';
if ( isset( $args['aria_label'] ) && ! empty( $args['aria_label'] ) ) {
$aria_label = 'aria-label="' . esc_attr( $args['aria_label'] ) . '"';
}
?>
<form class="search-form" method="get" action="<?php echo esc_url( home_url( '/' ) ); ?>" <?php echo $aria_label; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped above. ?>>
<label class="screen-reader-text" for="<?php echo $uid; ?>"><?php echo esc_html_x( 'Search for:', 'label', 'wssbase' ); ?></label>
<div class="input-group">
<input type="search" class="field search-field form-control" id="<?php echo $uid; ?>" name="s" value="<?php the_search_query(); ?>" placeholder="<?php echo esc_attr_x( 'Search …', 'placeholder', 'wssbase' ); ?>">
<input type="submit" class="submit search-submit btn btn-primary" name="submit" value="<?php echo esc_attr_x( 'Search', 'submit button', 'wssbase' ); ?>">
</div>
</form>
<?php