Settings
Registers the AI settings tab.
The tab is added from the Pro module rather than the shared settings class, so the free plugin carries no AI settings.
Namespace: WebberZone\Knowledge_Base\Pro\AI
Since: 3.2.0
Source: includes/pro/ai/class-settings.php line 24
Methods
__construct()
Constructor.
Line: 45
public function __construct( Provider $provider );
| Type | Name | Description |
|---|---|---|
Provider |
$provider |
Provider detection. |
get_defaults() static
Default values for the AI settings.
Kept free of translation calls so it is safe before init.
Since: 3.2.0
Line: 65
static public function get_defaults( ): array;
Returns: array — Default settings.
get_ranges() static
Numeric settings and their allowed range.
Since: 3.2.0
Line: 93
static public function get_ranges( ): array;
Returns: array — Map of setting ID to array( min, max ).
get_default_fallback_message() static
Default message shown when no answer is found.
Since: 3.2.0
Line: 110
static public function get_default_fallback_message( ): string;
Returns: string — Fallback message.
get_fallback_message() static
Message shown when no answer is found, from the setting or the default.
Since: 3.2.0
Line: 121
static public function get_fallback_message( ): string;
Returns: string — Fallback message.
add_section()
Add the AI tab.
Since: 3.2.0
Line: 135
public function add_section( $sections ): array;
| Type | Name | Description |
|---|---|---|
array |
$sections |
Settings sections. |
Returns: array — Updated sections.
add_defaults()
Add the defaults for the AI settings.
Since: 3.2.0
Line: 149
public function add_defaults( $defaults ): array;
| Type | Name | Description |
|---|---|---|
array |
$defaults |
Default settings. |
Returns: array — Updated defaults.
add_settings()
Add the AI settings fields.
Since: 3.2.0
Line: 161
public function add_settings( $settings ): array;
| Type | Name | Description |
|---|---|---|
array |
$settings |
Registered settings. |
Returns: array — Updated settings.
sanitize()
Clamp the AI settings to their allowed values.
Since: 3.2.0
Line: 352
public function sanitize( $output, $input ): array;
| Type | Name | Description |
|---|---|---|
array |
$output |
Sanitized settings. |
array |
$input |
Submitted settings. |
Returns: array — Updated settings.
provider_notice()
Show the provider status under the Ask the Docs header.
Uses only the cached support check, so ordinary settings page loads never wait on a provider. When nothing is cached, the notice runs a fresh check in the background.
Since: 3.2.0
Line: 434
public function provider_notice( $html, $args ): string;
| Type | Name | Description |
|---|---|---|
string |
$html |
HTML output. |
array |
$args |
Field arguments. |
Returns: string — Updated HTML output.
ajax_check_provider()
Check the provider for the settings page and return the notice to show.
Since: 3.2.0
Line: 460
public function ajax_check_provider( ): void;
Returns: void
print_check_script()
Print the script that runs the background provider check.
Printed in the footer because the settings field output is filtered through kses.
Since: 3.2.0
Line: 492
public function print_check_script( ): void;
Returns: void