RegisteredSettings final class
Minn\Runtime\RegisteredSettings · public/minn/src/Minn/Runtime/RegisteredSettings.php · 108 lines
Settings as register_setting keeps them (probe rest-settings): the arguments a plugin passes, filtered through register_setting_args and laid over the defaults (a string, in its group, unlabelled, undescribed, unsanitized, not shown in REST); the sanitize callback put on sanitize_option_{$name} with the value alone; a registered default answering get_option through filter_default_option; register_setting fired once kept. unregister_setting takes all of it back. Core's own settings (the site's title, tagline, addresses, formats, reading and discussion defaults) are registered as the REST server starts.
Constants and properties
| private | KEY = 'registered_settings' | |
| private | ARRAY_ITEMS = 'When registering an "array" setting to show in the REST API, you must specify the schema for each array item in "show_in_rest.schema.items".' | |
| private | CORE = array ( 'blogname' => array ( 0 => 'general', 1 => 'string', 2 => 'Title', 3 => 'Site title.', 4 => array ( 'name' => 'title', ), ), 'blogdescription' => array ( 0 => 'general', 1 => 'string', 2 => 'Tagline', 3 => 'Site tagline.', 4 => array ( 'name' => 'description', ), ), 'siteurl' => array ( 0 => 'general', 1 => 'string', 2 => '', 3 => 'Site URL.', 4 => array ( 'name' => 'url', 'schema' => array ( 'format' => 'uri', ), ), ), 'admin_email' => array ( 0 => 'general', 1 => 'string', 2 => '', 3 => 'This address is used for admin purposes, like new user notification.', 4 => array ( 'name' => 'email', 'schema' => array ( 'format' => 'email', ), ), ), 'timezone_string' => array ( 0 => 'general', 1 => 'string', 2 => '', 3 => 'A city in the same timezone as you.', 4 => array ( 'name' => 'timezone', ), ), 'date_format' => array ( 0 => 'general', 1 => 'string', 2 => '', 3 => 'A date format for all date strings.', 4 => true, ), 'time_format' => array ( 0 => 'general', 1 => 'string', 2 => '', 3 => 'A time format for all time strings.', 4 => true, ), 'start_of_week' => array ( 0 => 'general', 1 => 'integer', 2 => '', 3 => 'A day number of the week that the week should start on.', 4 => true, ), 'WPLANG' => array ( 0 => 'general', 1 => 'string', 2 => '', 3 => 'WordPress locale code.', 4 => array ( 'name' => 'language', ), 5 => 'en_US', ), 'use_smilies' => array ( 0 => 'writing', 1 => 'boolean', 2 => '', 3 => 'Convert emoticons like :-) and :-P to graphics on display.', 4 => true, 5 => true, ), 'default_category' => array ( 0 => 'writing', 1 => 'integer', 2 => '', 3 => 'Default post category.', 4 => true, ), 'default_post_format' => array ( 0 => 'writing', 1 => 'string', 2 => '', 3 => 'Default post format.', 4 => true, ), 'posts_per_page' => array ( 0 => 'reading', 1 => 'integer', 2 => 'Maximum posts per page', 3 => 'Blog pages show at most.', 4 => true, 5 => 10, ), 'show_on_front' => array ( 0 => 'reading', 1 => 'string', 2 => 'Show on front', 3 => 'What to show on the front page', 4 => true, ), 'page_on_front' => array ( 0 => 'reading', 1 => 'integer', 2 => 'Page on front', 3 => 'The ID of the page that should be displayed on the front page', 4 => true, ), 'page_for_posts' => array ( 0 => 'reading', 1 => 'integer', 2 => '', 3 => 'The ID of the page that should display the latest posts', 4 => true, ), 'default_ping_status' => array ( 0 => 'discussion', 1 => 'string', 2 => '', 3 => 'Allow link notifications from other blogs (pingbacks and trackbacks) on new articles.', 4 => array ( 'schema' => array ( 'enum' => array ( 0 => 'open', 1 => 'closed', ), ), ), ), 'default_comment_status' => array ( 0 => 'discussion', 1 => 'string', 2 => 'Allow comments on new posts', 3 => 'Allow people to submit comments on new posts.', 4 => array ( 'schema' => array ( 'enum' => array ( 0 => 'open', 1 => 'closed', ), ), ), ), ) | Core's settings: name => [group, type, label, description, show_in_rest, default when it has one]. |
Public
| static | addError(mixed $setting, mixed $code, mixed $message, mixed $type = 'error'): void# | A settings error noted for the settings screen to show (add_settings_error). |
| static | all(): array# | Every registered setting by option name, in registration order. @return array<string, array<string, mixed>> @return array<string, array<string, mixed>> |
| static | register(string $group, string $name, mixed $args): void# | register_setting: $args an array, or (as it once was) the sanitize callback alone. |
| static | unregister(string $group, string $name, mixed $deprecated = ''): void# | unregister_setting: the setting, its sanitize callback and its default gone, unregister_setting fired. |
| static | defaultOf(string $option, mixed $default): mixed# | A setting's registered default, or $default when it registered none. |
| static | registerCore(): void# | register_initial_settings: core's settings, each through register_setting. |
Nothing matches.