diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-01-07 13:06:14 +0100 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-01-07 13:06:14 +0100 |
| commit | 7086111ad4dd997e12a3220e1ee60c9b9bcf0bb8 (patch) | |
| tree | f7453d7dd5cbaaab246e23810b02d3edf1e451be /srcs/wordpress/wp-content/themes/twentytwenty/searchform.php | |
| parent | c59bdcf77c50cbe89b4a93782cdd6d9e7532080e (diff) | |
| download | ft_server-7086111ad4dd997e12a3220e1ee60c9b9bcf0bb8.tar.gz ft_server-7086111ad4dd997e12a3220e1ee60c9b9bcf0bb8.tar.bz2 ft_server-7086111ad4dd997e12a3220e1ee60c9b9bcf0bb8.zip | |
Added wordpress
Diffstat (limited to 'srcs/wordpress/wp-content/themes/twentytwenty/searchform.php')
| -rw-r--r-- | srcs/wordpress/wp-content/themes/twentytwenty/searchform.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/srcs/wordpress/wp-content/themes/twentytwenty/searchform.php b/srcs/wordpress/wp-content/themes/twentytwenty/searchform.php new file mode 100644 index 0000000..21e6efb --- /dev/null +++ b/srcs/wordpress/wp-content/themes/twentytwenty/searchform.php @@ -0,0 +1,28 @@ +<?php +/** + * The searchform.php template. + * + * Used any time that get_search_form() is called. + * + * @link https://developer.wordpress.org/themes/basics/template-hierarchy/ + * + * @package WordPress + * @subpackage Twenty_Twenty + * @since 1.0.0 + */ + +/* + * Generate a unique ID for each form and a string containing an aria-label if + * one was passed to get_search_form() in the args array. + */ +$unique_id = twentytwenty_unique_id( 'search-form-' ); + +$aria_label = ! empty( $args['label'] ) ? 'aria-label="' . esc_attr( $args['label'] ) . '"' : ''; +?> +<form role="search" <?php echo $aria_label; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped above. ?> method="get" class="search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>"> + <label for="<?php echo esc_attr( $unique_id ); ?>"> + <span class="screen-reader-text"><?php _e( 'Search for:', 'twentytwenty' ); // phpcs:ignore: WordPress.Security.EscapeOutput.UnsafePrintingFunction -- core trusts translations ?></span> + <input type="search" id="<?php echo esc_attr( $unique_id ); ?>" class="search-field" placeholder="<?php echo esc_attr_x( 'Search …', 'placeholder', 'twentytwenty' ); ?>" value="<?php echo get_search_query(); ?>" name="s" /> + </label> + <input type="submit" class="search-submit" value="<?php echo esc_attr_x( 'Search', 'submit button', 'twentytwenty' ); ?>" /> +</form> |
