Tribe__Events__Main::setup_keyword_search_in_bar( array $filters )

Set up the keyword search in the tribe events bar.


Parameters

$filters

(array) (Required) The current filters in the bar array.


Top ↑

Return

(array) The modified filters array.


Top ↑

Source

File: src/Tribe/Main.php

		public function setup_keyword_search_in_bar( $filters ) {

			$value = '';
			if ( ! empty( $_REQUEST['tribe-bar-search'] ) ) {
				$value = esc_attr( $_REQUEST['tribe-bar-search'] );
			}

			if ( tribe_get_option( 'tribeDisableTribeBar', false ) == false ) {
				$label = sprintf( esc_html__( 'Search for %s by Keyword.', 'the-events-calendar' ), $this->plural_event_label );
				$filters['tribe-bar-search'] = array(
					'name'       => 'tribe-bar-search',
					'caption'    => esc_html__( 'Search', 'the-events-calendar' ),
					'html'       => '<input type="text" name="tribe-bar-search" id="tribe-bar-search" aria-label="' . esc_attr( $label ) . '" value="' . esc_attr( $value ) . '" placeholder="' . esc_attr__( 'Keyword', 'the-events-calendar' ) . '">',
				);
			}

			return $filters;
		}