Settings
Class to register the settings.
Namespace: WebberZone\Knowledge_Base\Admin
Since: 2.3.0
Source: includes/admin/class-settings.php line 26
Methods
__construct()
Main constructor class.
Since: 2.3.0
Line: 147
public function __construct( );
taxonomy_search_tom_select() static
AJAX handler for Tom Select taxonomy searches.
Used by Settings API and Setup Wizard taxonomy autocomplete fields.
Since: 3.0.0
Line: 177
static public function taxonomy_search_tom_select( ): void;
Returns: void
initialise_settings()
Initialise the settings API.
Since: 2.3.0
Line: 264
public function initialise_settings( );
get_defaults() static
Raw default values for every setting, keyed by option ID.
Deliberately contains no translation calls, so it is safe to invoke before init.
Values are pre-normalised (checkboxes as 1/0) and this array is intentionally
unfiltered — the wzkb_settings_defaults filter is applied by the consumers instead.
Since: 3.1.2
Line: 295
static public function get_defaults( ): array;
Returns: array — Raw default values keyed by option ID.
settings_defaults() static
Get settings defaults.
Since: 3.0.0
Line: 378
static public function settings_defaults( ): array;
Returns: array — Default settings.
get_translation_strings()
Array containing the translation strings.
Since: 1.8.0
Line: 448
public function get_translation_strings( ): array;
Returns: array — Translation strings.
get_menus()
Get the admin menus.
Line: 481
public function get_menus( ): array;
Returns: array — Admin menus.
get_settings_sections() static
Array containing the settings’ sections.
Since: 2.3.0
Line: 504
static public function get_settings_sections( ): array;
Returns: array — Settings array
get_registered_settings() static
Retrieve the array of plugin settings
Since: 2.3.0
Line: 531
static public function get_registered_settings( ): array;
Returns: array — Settings array
settings_general() static
Retrieve the array of General settings
Since: 2.3.0
Line: 559
static public function settings_general( ): array;
Returns: array — General settings array
settings_output() static
Retrieve the array of Output settings
Since: 2.3.0
Line: 725
static public function settings_output( ): array;
Returns: array — Output settings array
settings_styles() static
Retrieve the array of Styles settings
Since: 2.3.0
Line: 892
static public function settings_styles( ): array;
Returns: array — Styles settings array
settings_github() static
Retrieve the array of GitHub integration settings.
Settings are registered via the wzkb_settings_github filter in the Pro GitHub module.
Since: 3.1.0
Line: 976
static public function settings_github( ): array;
Returns: array — GitHub settings array.
settings_pro() static
Retrieve the array of Pro settings
Since: 3.0.0
Line: 1195
static public function settings_pro( ): array;
Returns: array — Pro settings array
get_kb_styles() static
Get available KB styles.
Returns free styles by default. Pro and other extensions can add their styles via filter.
Since: 3.0.0
Line: 1441
static public function get_kb_styles( ): array;
Returns: array — Array of style options.
plugin_actions_links()
Adding WordPress plugin action links.
Since: 3.0.0
Line: 1468
public function plugin_actions_links( $links ): array;
| Type | Name | Description |
|---|---|---|
array |
$links |
Array of links. |
Returns: array
plugin_row_meta()
Add meta links on Plugins page.
Since: 3.0.0
Line: 1487
public function plugin_row_meta( $links, $file ): array;
| Type | Name | Description |
|---|---|---|
array |
$links |
Array of Links. |
string |
$file |
Current file. |
Returns: array
get_help_sidebar()
Get the help sidebar content to display on the plugin settings page.
Since: 1.8.0
Line: 1506
public function get_help_sidebar( );
get_help_tabs()
Get the help tabs to display on the plugin settings page.
Since: 2.3.0
Line: 1534
public function get_help_tabs( );
admin_head()
Add CSS to admin head.
Since: 2.2.0
Line: 1585
public function admin_head( );
get_admin_footer_text() static
Add footer text on the plugin page.
Since: 2.0.0
Line: 1613
static public function get_admin_footer_text( );
admin_enqueue_scripts()
Enqueue scripts and styles.
Since: 2.3.0
Line: 1630
public function admin_enqueue_scripts( $hook );
| Type | Name | Description |
|---|---|---|
string |
$hook |
Current hook. |
change_settings_on_save()
Modify settings when they are being saved.
Since: 2.3.0
Line: 1647
public function change_settings_on_save( $settings ): array;
| Type | Name | Description |
|---|---|---|
array |
$settings |
Settings array. |
Returns: array — Sanitized settings array.
flush_rewrite_rules_if_pending()
Flush rewrite rules after settings have been persisted and registered.
Since: 3.1.4
Line: 1664
public function flush_rewrite_rules_if_pending( ): void;
Returns: void
add_github_pat_verify_button()
Add a “Verify Token” button after the GitHub PAT field.
Since: 3.1.0
Line: 1684
public function add_github_pat_verify_button( string $html, array $args ): string;
| Type | Name | Description |
|---|---|---|
string |
$html |
Field output HTML. |
array |
$args |
Field arguments. |
Returns: string
get_github_repo_search_attributes() static
Get field attributes for a GitHub repository name autocomplete field.
Since: 3.1.0
Line: 1717
static public function get_github_repo_search_attributes( ): array;
Returns: array — Field attributes array.
resolve_github_pat() static
Resolve the effective GitHub PAT for a repository search request.
Precedence:
- The PAT typed into the current repeater row (if it looks like a real
token — i.e. doesn’t contain the masking character
*). - The PAT saved against the row identified by
row_idin thegithub_repositoriessetting. - The global
github_patsetting.
Since: 3.1.0
Line: 1751
static public function resolve_github_pat( string $row_pat, string $row_id ): string;
| Type | Name | Description |
|---|---|---|
string |
$row_pat |
Raw value from the row’s PAT input (may be masked). |
string |
$row_id |
Persistent row identifier from the repeater. |
Returns: string — Decrypted/plaintext PAT, or empty string if none.
handle_github_repo_search()
AJAX handler for GitHub repository name autocomplete (TomSelect).
Fetches /user/repos (repos the PAT has access to) and returns those whose name contains the query string, in the { id, name } format expected by TomSelect. Results are cached in a transient for 24 hours; use the Refresh button to bust the cache.
Since: 3.1.0
Line: 1793
public function handle_github_repo_search( ): void;
Returns: void
handle_clear_github_repos_cache()
AJAX handler to clear the GitHub repository list cache.
Since: 3.1.0
Line: 1911
public function handle_clear_github_repos_cache( ): void;
Returns: void
render_wizard_button()
Add Setup Wizard button on the settings page.
Since: 3.0.0
Line: 1939
public function render_wizard_button( ): void;
Returns: void