Settings
Settings class.
Namespace: WebberZone\Code_Block_Highlighting\Admin
Since: 1.0.0
Source: includes/admin/class-settings.php line 22
Methods
__construct()
Constructor.
Since: 1.1.0
Line: 88
public function __construct( );
initialise_settings()
Initialise the Settings_API instance.
Since: 1.1.0
Line: 98
public function initialise_settings( ): void;
Returns: void
get_settings_page_url() static
Get the admin URL of the settings page.
Registered with add_options_page(), so it lives under options-general.php. Linking to admin.php?page=… resolves to an unregistered hook name and WordPress answers 403, so every link is built from here.
Since: 1.2.2
Line: 172
static public function get_settings_page_url( ): string;
Returns: string
get_settings_sections() static
Get settings sections (tabs).
Since: 1.1.0
Line: 183
static public function get_settings_sections( ): array;
Returns: array
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 wzcbh_settings_defaults filter is applied by the consumers
instead.
Since: 1.3.0
Line: 201
static public function get_defaults( ): array;
Returns: array — Raw default values keyed by option ID.
get_registered_settings() static
Get registered settings.
Since: 1.1.0
Line: 222
static public function get_registered_settings( ): array;
Returns: array
settings_defaults() static
Get default settings values derived from registered settings.
Since: 1.1.0
Line: 312
static public function settings_defaults( ): array;
Returns: array — Default settings.
get_language_field_attributes() static
Get field attributes for the Tom Select language picker.
Since: 1.1.0
Line: 342
static public function get_language_field_attributes( ): array;
Returns: array
enqueue_language_data()
Inject Prism language list into WZTomSelectSettings for the settings page autocomplete.
Since: 1.1.0
Line: 363
public function enqueue_language_data( string $hook ): void;
| Type | Name | Description |
|---|---|---|
string |
$hook |
Current admin page hook. |
Returns: void
get_color_scheme_slug() static
Get the active color scheme slug, validated against the registered themes.
The saved option is interpolated into a filesystem path and an asset URL, so every consumer resolves it through here. An unrecognised value falls back to the default rather than reaching the filesystem.
Since: 1.2.2
Line: 396
static public function get_color_scheme_slug( ): string;
Returns: string — A slug that is always a key of self::$color_schemes.
get_color_scheme_css() static
Get the URL (or filesystem path) to the active color scheme CSS file.
Returns the plain unminified LTR path; enqueuing with SCRIPT_DEBUG and RTL awareness is handled by Styles_Handler.
Since: 1.0.0
Line: 413
static public function get_color_scheme_css( bool $return_path = ... ): string;
| Type | Name | Description |
|---|---|---|
bool |
$return_path |
When true, returns the filesystem path instead of the URL. |
Returns: string
extract_theme_colors() static
Extract the base background and foreground colours from a Prism theme CSS file.
Strips @media/@supports blocks first (forced-colors overrides would otherwise win
as last match), then evaluates selector lists per comma-separated part so
:not(pre)>code[...], pre[...]-style rules are not rejected wholesale. Transparent
backgrounds are treated as absent.
Works against both the unminified and minified builds of each theme.
Since: 1.2.0
Line: 450
static public function extract_theme_colors( string $css_path ): array;
| Type | Name | Description |
|---|---|---|
string |
$css_path |
Absolute filesystem path to the theme CSS file. |
Returns: array — string, color: string} Raw CSS values; empty strings when not found.