LiveSettings final readonly class
Minn\Rest\LiveSettings · public/minn/src/Minn/Rest/LiveSettings.php · 77 lines
wp/v2/settings with plugins loaded, served from the registered settings as the reference serves it (probe rest-settings): every setting shown in REST, core's and a plugin's alike, under its REST name. A read asks rest_pre_get_setting first, then get_option with the schema's default, and a value its schema refuses reads as null. A write takes the body's values its schema accepts (null always), offers each to rest_pre_update_setting, deletes the option for null (refused when what is stored does not fit the schema, since null could not restore it) and otherwise hands it to update_option.
Constants and properties
| private | readonly Minn\Rest\Schema $schema | Promoted from the constructor. |
Public
| new | __construct(Minn\Rest\Schema $schema)# | |
| method | shown(): array# | The settings shown in REST, by REST name, with the arguments the filters are handed. @return array<string, array{name: string, schema: array<string, mixed>, option_name: string}> |
| method | payload(): array# | Every shown setting's value. @return array<string, mixed> @return array<string, mixed> |
| method | store(array $body): void# | Writes the shown settings a body names, after refusing the values their schemas refuse. |
Internals 1
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | refuseInvalid(array $shown, array $body): void# |
|
Nothing matches.