Abilities
Registers Pro search statistics and cache abilities.
Namespace: WebberZone\Better_Search\Pro
Since: 4.5.0
Source: includes/pro/class-abilities.php line 24
Methods
__construct()
Register the Pro ability hook.
Since: 4.5.0
Line: 31
public function __construct( );
register_abilities()
Register the Pro abilities.
Since: 4.5.0
Line: 45
public function register_abilities( ): void;
Returns: void
can_suggest()
Check whether the current user can request a spelling suggestion.
The front end already shows these suggestions to anonymous visitors, so this matches the search ability rather than gating it behind site management.
Since: 4.5.0
Line: 216
public function can_suggest( $input = ... ): bool;
| Type | Name | Description |
|---|---|---|
mixed |
$input |
Ability input. |
Returns: bool — Whether the suggestion may be requested.
suggest_search_term()
Suggest a corrected spelling for a search phrase.
Since: 4.5.0
Line: 230
public function suggest_search_term( $input ): array|\WP_Error;
| Type | Name | Description |
|---|---|---|
mixed |
$input |
Ability input. |
Returns: array|\WP_Error — Suggestion or an error.
can_manage()
Check whether the current user can manage the site.
Since: 4.5.0
Line: 280
public function can_manage( $input = ... ): bool;
| Type | Name | Description |
|---|---|---|
mixed |
$input |
Ability input. |
Returns: bool — Whether the user can manage site options.
get_popular_searches()
Get the most popular search terms.
Since: 4.5.0
Line: 294
public function get_popular_searches( $input = ... ): array|\WP_Error;
| Type | Name | Description |
|---|---|---|
mixed |
$input |
Ability input. |
Returns: array|\WP_Error — Search terms with counts or an error.
clear_cache()
Clear the Better Search cache.
Since: 4.5.0
Line: 350
public function clear_cache( $input ): array|\WP_Error;
| Type | Name | Description |
|---|---|---|
mixed |
$input |
Ability input. |
Returns: array|\WP_Error — Cache clear result or an error.