Recent

Pro class Pro only

Pro

Class to load all the pro features.

Namespace: WebberZone\Better_Search\Pro
Source: includes/class-pro.php line 20

Methods

__construct()

Constructor.

Line: 91

public function __construct(  );

exclude_special_pages()

Exclude special pages (front and posts pages) from search results.

Since: 4.3.0
Line: 137

public function exclude_special_pages( $exclude_post_ids, $args ): int[];
TypeNameDescription
int[]$exclude_post_idsArray of post IDs to exclude.
array$argsQuery arguments.

Returns: int[] — Modified array of post IDs to exclude.

set_min_relevance()

Set the minimum relevance for the search query.

Since: 4.0.0
Line: 169

public function set_min_relevance( $request, $query, $instance ): string;
TypeNameDescription
string$requestThe request string.
\WP_Query$queryThe WP_Query instance.
\Better_Search_Core_Query$instanceThe Better_Search_Core_Query instance.

Returns: string — Modified request string.

add_custom_clauses()

Add custom clauses to the search query.

Since: 4.0.0
Line: 212

public function add_custom_clauses( $clauses, $term, $like_op, $andor_op, $query, $instance ): array;
TypeNameDescription
array$clausesArray of clauses.
string$termThe search term (prepared for LIKE).
string$like_opThe LIKE operator.
string$andor_opThe AND/OR operator.
\WP_Query$queryThe WP_Query instance.
\Better_Search_Core_Query$instanceThe Better_Search_Core_Query instance.

Returns: array — Array of clauses.

Perform LIKE-based fallback search when FULLTEXT returns zero results.

Since: 4.2.0
Line: 232

public function like_fallback_search( $posts, $query, $instance ): \WP_Post[];
TypeNameDescription
\WP_Post[]$postsArray of post objects.
\WP_Query$queryThe WP_Query instance.
\Better_Search_Core_Query$instanceThe Better_Search_Core_Query instance.

Returns: \WP_Post[] — Array of post objects, potentially with fallback results.

update_rest_post_search_query()

Modify the search query to add minimum relevance.

Since: 4.0.0
Line: 277

public function update_rest_post_search_query( $args, $request ): array;
TypeNameDescription
array$argsArray of query arguments.
array$requestArray of request parameters.

Returns: array — Modified query arguments.

init_rest_api_hooks()

Initialize REST API hooks.

Since: 4.2.0
Line: 311

public function init_rest_api_hooks(  ): void;

Returns: void

modify_rest_post_query()

Modify REST post queries to use Better Search when better_search_query parameter is present.

Since: 4.2.0
Line: 329

public function modify_rest_post_query( array $args, $request ): array;
TypeNameDescription
array$argsArray of arguments for WP_Query.
\WP_REST_Request$requestThe REST request object.

Returns: array — Modified query arguments.

free_hooks() static

Initialize hooks that should run even when Pro class isn’t instantiated. This allows certain Pro features to work in free version contexts.

Since: 4.2.0
Line: 375

static public function free_hooks(  ): void;

Returns: void