settings-schema.php
Settings schema and presets
The single table of every setting this plugin knows: type, default, allowed values, section, whether the role exemption applies, the core constant that locks it, and the badges the settings page shows. Defaults and presets live here and nowhere else, so changing one of them is a one-line edit.
Tags
Table of Contents
Functions
- jpkcom_harden_trim_schema_entry() : array<string, mixed>
- Build one schema entry with every field present.
- jpkcom_harden_trim_schema() : array<string, array<string, mixed>>
- Every setting, in settings-page order (performance, head, privacy, security, roles).
- jpkcom_harden_trim_defaults() : array<string, mixed>
- Default value of every setting.
-
jpkcom_harden_trim_presets()
: array{harmless: array
, recommended: array , strict: array } - The three presets as overrides of the defaults.
- jpkcom_harden_trim_preset_managed_keys() : array<int, string>
- Keys a preset assigns a value to; every other key is never touched.
Functions
jpkcom_harden_trim_schema_entry()
Build one schema entry with every field present.
jpkcom_harden_trim_schema_entry(string $type, mixed $default, string $group[, array<string, mixed> $extra = array() ]) : array<string, mixed>
Parameters
- $type : string
-
One of bool, enum, int, roles.
- $default : mixed
-
Default value on activation.
- $group : string
-
Section: performance, head, privacy, security, roles.
- $extra : array<string, mixed> = array()
-
Overrides for choices, nullable, role_scoped, core_constant, block_theme_unavailable, flags.
Tags
Return values
array<string, mixed> —The complete entry.
jpkcom_harden_trim_schema()
Every setting, in settings-page order (performance, head, privacy, security, roles).
jpkcom_harden_trim_schema() : array<string, array<string, mixed>>
Flags drive the badges on the settings page: appearance (changes how
the site looks), editors (changes the editing workflow), global (the
role exemption does not apply), irreversible (effects that a later
switch-off does not undo).
Tags
Return values
array<string, array<string, mixed>> —Key => entry.
jpkcom_harden_trim_defaults()
Default value of every setting.
jpkcom_harden_trim_defaults() : array<string, mixed>
Tags
Return values
array<string, mixed> —Key => default.
jpkcom_harden_trim_presets()
The three presets as overrides of the defaults.
jpkcom_harden_trim_presets() : array{harmless: array, recommended: array, strict: array}
A key a preset does not list gets its default when the preset is applied (see jpkcom_harden_trim_preset_managed_keys()).
Tags
Return values
array{harmless: arrayjpkcom_harden_trim_preset_managed_keys()
Keys a preset assigns a value to; every other key is never touched.
jpkcom_harden_trim_preset_managed_keys() : array<int, string>
The excluded keys either have a break path no preset may switch on, or
hold a decision only the site owner can make (role lists, application
passwords, HSTS, feed discovery, comments). xmlrpc is managed: it is
on in every preset, so no preset can reopen XML-RPC.
Tags
Return values
array<int, string> —Keys in schema order.