protected $performSearchOnClick = true;
protected $validateTitle = false;
protected $highlightFirst = false;
+ protected $dataLocation = 'header';
/**
* @param array $config Configuration options
* @param boolean|null $config['performSearchOnClick'] If true, the script will start a search
* whenever a user hits a suggestion. If false, the text of the suggestion is inserted into the
* text field only (default: true)
+ * @param string $config['dataLocation'] Where the search input field will be
+ * used (header or content, default: header)
*/
public function __construct( array $config = [] ) {
$config = array_merge( [
- 'infusable' => true,
'maxLength' => null,
'type' => 'search',
'icon' => 'search',
- 'dataLocation' => 'content',
], $config );
// Parent constructor
$this->performSearchOnClick = $config['performSearchOnClick'];
}
- if ( $config['dataLocation'] ) {
+ if ( isset( $config['dataLocation'] ) ) {
// identifies the location of the search bar for tracking purposes
$this->dataLocation = $config['dataLocation'];
}