Recent

Settings class

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: 142

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: 171

static public function taxonomy_search_tom_select(  ): void;

Returns: void

initialise_settings()

Initialise the settings API.

Since: 2.3.0
Line: 258

public function initialise_settings(  );

settings_defaults() static

Get settings defaults.

Since: 3.0.0
Line: 285

static public function settings_defaults(  ): array;

Returns: array — Default settings.

get_translation_strings()

Array containing the translation strings.

Since: 1.8.0
Line: 355

public function get_translation_strings(  ): array;

Returns: array — Translation strings.

get_menus()

Get the admin menus.

Line: 388

public function get_menus(  ): array;

Returns: array — Admin menus.

get_settings_sections() static

Array containing the settings’ sections.

Since: 2.3.0
Line: 411

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: 438

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: 466

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: 631

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: 797

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: 880

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: 1098

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: 1343

static public function get_kb_styles(  ): array;

Returns: array — Array of style options.

Adding WordPress plugin action links.

Since: 3.0.0
Line: 1370

public function plugin_actions_links( $links ): array;
TypeNameDescription
array$linksArray of links.

Returns: array

plugin_row_meta()

Add meta links on Plugins page.

Since: 3.0.0
Line: 1389

public function plugin_row_meta( $links, $file ): array;
TypeNameDescription
array$linksArray of Links.
string$fileCurrent file.

Returns: array

get_help_sidebar()

Get the help sidebar content to display on the plugin settings page.

Since: 1.8.0
Line: 1408

public function get_help_sidebar(  );

get_help_tabs()

Get the help tabs to display on the plugin settings page.

Since: 2.3.0
Line: 1436

public function get_help_tabs(  );

admin_head()

Add CSS to admin head.

Since: 2.2.0
Line: 1487

public function admin_head(  );

Add footer text on the plugin page.

Since: 2.0.0
Line: 1515

static public function get_admin_footer_text(  );

admin_enqueue_scripts()

Enqueue scripts and styles.

Since: 2.3.0
Line: 1532

public function admin_enqueue_scripts( $hook );
TypeNameDescription
string$hookCurrent hook.

change_settings_on_save()

Modify settings when they are being saved.

Since: 2.3.0
Line: 1549

public function change_settings_on_save( $settings ): array;
TypeNameDescription
array$settingsSettings array.

Returns: array — Sanitized settings array.

add_github_pat_verify_button()

Add a “Verify Token” button after the GitHub PAT field.

Since: 3.1.0
Line: 1568

public function add_github_pat_verify_button( string $html, array $args ): string;
TypeNameDescription
string$htmlField output HTML.
array$argsField arguments.

Returns: string

get_github_repo_search_attributes() static

Get field attributes for a GitHub repository name autocomplete field.

Since: 3.1.0
Line: 1601

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:

  1. The PAT typed into the current repeater row (if it looks like a real token — i.e. doesn’t contain the masking character *).
  2. The PAT saved against the row identified by row_id in the github_repositories setting.
  3. The global github_pat setting.

Since: 3.1.0
Line: 1635

static public function resolve_github_pat( string $row_pat, string $row_id ): string;
TypeNameDescription
string$row_patRaw value from the row’s PAT input (may be masked).
string$row_idPersistent row identifier from the repeater.

Returns: string — Decrypted/plaintext PAT, or empty string if none.

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: 1677

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: 1795

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: 1823

public function render_wizard_button(  ): void;

Returns: void