[ Index ]

WordPress 5.4.1

[ Index ]     [ Classes ]     [ Functions ]     [ Variables ]     [ Constants ]     [ Statistics ]    

title

Body

[close]

/wp-content/themes/twentytwenty/ -> searchform.php (source)

   1  <?php
   2  /**
   3   * The searchform.php template.
   4   *
   5   * Used any time that get_search_form() is called.
   6   *
   7   * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
   8   *
   9   * @package WordPress
  10   * @subpackage Twenty_Twenty
  11   * @since Twenty Twenty 1.0
  12   */
  13  
  14  /*
  15   * Generate a unique ID for each form and a string containing an aria-label
  16   * if one was passed to get_search_form() in the args array.
  17   */
  18  $twentytwenty_unique_id = twentytwenty_unique_id( 'search-form-' );
  19  
  20  $twentytwenty_aria_label = ! empty( $args['label'] ) ? 'aria-label="' . esc_attr( $args['label'] ) . '"' : '';
  21  ?>
  22  <form role="search" <?php echo $twentytwenty_aria_label; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped above. ?> method="get" class="search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>">
  23      <label for="<?php echo esc_attr( $twentytwenty_unique_id ); ?>">
  24          <span class="screen-reader-text"><?php _e( 'Search for:', 'twentytwenty' ); // phpcs:ignore: WordPress.Security.EscapeOutput.UnsafePrintingFunction -- core trusts translations ?></span>
  25          <input type="search" id="<?php echo esc_attr( $twentytwenty_unique_id ); ?>" class="search-field" placeholder="<?php echo esc_attr_x( 'Search &hellip;', 'placeholder', 'twentytwenty' ); ?>" value="<?php echo get_search_query(); ?>" name="s" />
  26      </label>
  27      <input type="submit" class="search-submit" value="<?php echo esc_attr_x( 'Search', 'submit button', 'twentytwenty' ); ?>" />
  28  </form>


Generated: Tue May 19 15:51:04 2020 Cross-referenced by PHPXref 0.7.1