Frontend
Adds explicit AI actions without intercepting ordinary search.
Namespace: WebberZone\Better_Search\Pro\AI
Since: 4.5.0
Source: includes/pro/ai/class-frontend.php line 20
Methods
__construct()
Register the form integration and deliberate theme placement.
Line: 33
public function __construct( AI $ai );
| Type | Name | Description |
|---|---|---|
AI |
$ai |
Module. |
register_shortcode()
Register explicit placement for classic and block themes.
Since: 4.5.0
Line: 48
public function register_shortcode( ): void;
Returns: void
register_assets()
Register assets. Provider checks run only on a submitted question.
Since: 4.5.0
Line: 59
public function register_assets( ): void;
Returns: void
enhance_form()
Wrap a Better Search form with an optional AI action.
Since: 4.5.0
Line: 115
public function enhance_form( string $form, $search_query = ..., $args = ..., string $wrapper = ... ): string;
| Type | Name | Description |
|---|---|---|
string |
$form |
Form HTML. |
mixed |
$search_query |
Search query, or the parsed block array when filtering a block. |
mixed |
$args |
Form arguments or a WP_Block instance. |
string |
$wrapper |
Wrapper class. |
Returns: string — Enhanced form.
enhance_search_form()
Wrap a theme search form from get_search_form() with an optional AI action.
Since: 4.5.0
Line: 138
public function enhance_search_form( $form, $args = ... ): mixed;
| Type | Name | Description |
|---|---|---|
mixed |
$form |
Form HTML. |
mixed |
$args |
get_search_form() arguments. |
Returns: mixed — Enhanced form, or the original value when it is not a string.
render_panel()
Render a standalone panel for a shortcode or a theme action.
Since: 4.5.0
Line: 171
public function render_panel( ): string;
Returns: string — Panel HTML.
output_panel()
Output the panel at a theme-selected location.
Since: 4.5.0
Line: 184
public function output_panel( ): void;
Returns: void