Recent

Trackerclass

Tracker

Tracks search queries via the tracker endpoint and its AJAX handlers.

Namespace: WebberZone\Better_Search
Since: 3.3.0
Source: includes/class-tracker.php line 21

Methods

__construct()

Constructor class.

Since: 3.3.0
Line: 28

public function __construct(  );

enqueue_scripts() static

Enqueues the scripts needed by Better Search.

Since: 1.9.7
Line: 42

static public function enqueue_scripts(  ): void;

Returns: void

should_track() static

Whether the current request should have its search query tracked.

Callers must establish that the request is a search themselves.

Since: 4.4.0
Line: 97

static public function should_track(  ): bool;

Returns: bool — Whether the search query should be tracked.

query_vars() static

Function to add additional queries to query_vars.

Since: 2.0.0
Line: 139

static public function query_vars( $vars ): array;
Type Name Description
array $vars Query variables array.

Returns: array — Query variables array with Better Search parameters appended

parse_request() static

Parses the WordPress object to update/display the count.

Since: 2.0.0
Line: 161

static public function parse_request( $wp );
Type Name Description
\WP $wp Current WordPress environment instance.

tracker_parser() static

Parse the ajax response.

Since: 2.4.0
Line: 201

static public function tracker_parser(  );

update_count() static

Function to update the count in the database.

Since: 3.3.0
Line: 225

static public function update_count( $search_query ): string;
Type Name Description
string $search_query Search Query.

Returns: string — Response on database update.