-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsearchform.php
More file actions
35 lines (27 loc) · 948 Bytes
/
searchform.php
File metadata and controls
35 lines (27 loc) · 948 Bytes
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
27
28
29
30
31
32
33
34
35
<?php
/**
* Template for displaying search forms
*
* @package WordPress
* @subpackage quick-start
* @since 1.0.0
* @version 1.0.0
*/
/**
* File Security Check.
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$unique_id = esc_attr( uniqid( 'search-form-' ) );
?>
<form role="search" method="get" class="search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>">
<label for="<?php echo $unique_id; ?>">
<span class="screen-reader-text"><?php echo _x( 'Search for:', 'label', 'quick-start' ); ?></span>
</label>
<input type="search" id="<?php echo $unique_id; ?>" class="search-form__field"
placeholder="<?php echo esc_attr_x( 'Search …', 'placeholder', 'quick-start' ); ?>"
value="<?php echo get_search_query(); ?>" name="s"/>
<button type="submit" class="button search-form__button"><?php echo _x( 'Search', 'search form submit button',
'quick-start' ); ?></button>
</form>