-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Docs: Describe the shape of post type, taxonomy and capability data #13220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
d643ede
7a0a968
be7d990
5349fb2
95114ea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2982,15 +2982,17 @@ function register_initial_settings() { | |
| * @param array $args { | ||
| * Data used to describe the setting when registered. | ||
| * | ||
| * @type string $type The type of data associated with this setting. | ||
| * Valid values are 'string', 'boolean', 'integer', 'number', 'array', and 'object'. | ||
| * @type string $label A label of the data attached to this setting. | ||
| * @type string $description A description of the data attached to this setting. | ||
| * @type callable $sanitize_callback A callback function that sanitizes the option's value. | ||
| * @type bool|array $show_in_rest Whether data associated with this setting should be included in the REST API. | ||
| * When registering complex settings, this argument may optionally be an | ||
| * array with a 'schema' key. | ||
| * @type mixed $default Default value when calling `get_option()`. | ||
| * @type string $type The type of data associated with this setting. | ||
| * Valid values are 'string', 'boolean', 'integer', 'number', 'array', | ||
| * and 'object'. | ||
| * @type string $label A label of the data attached to this setting. | ||
| * @type string $description A description of the data attached to this setting. | ||
| * @type callable|null $sanitize_callback A callback function that sanitizes the option's value. | ||
| * Default null. | ||
| * @type bool|array $show_in_rest Whether data associated with this setting should be included in the | ||
| * REST API. When registering complex settings, this argument may | ||
| * optionally be an array with a 'schema' key. | ||
|
Comment on lines
+2992
to
+2994
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TODO: In a future PR add the |
||
| * @type mixed $default Default value when calling `get_option()`. | ||
| * } | ||
| */ | ||
| function register_setting( $option_group, $option_name, $args = array() ) { | ||
|
|
@@ -3201,15 +3203,18 @@ function unregister_setting( $option_group, $option_name, $deprecated = '' ) { | |
| * @type array ...$0 { | ||
| * Data used to describe the setting when registered. | ||
| * | ||
| * @type string $type The type of data associated with this setting. | ||
| * Valid values are 'string', 'boolean', 'integer', 'number', 'array', and 'object'. | ||
| * @type string $label A label of the data attached to this setting. | ||
| * @type string $description A description of the data attached to this setting. | ||
| * @type callable $sanitize_callback A callback function that sanitizes the option's value. | ||
| * @type bool|array $show_in_rest Whether data associated with this setting should be included in the REST API. | ||
| * When registering complex settings, this argument may optionally be an | ||
| * array with a 'schema' key. | ||
| * @type mixed $default Default value when calling `get_option()`. | ||
| * @type string $type The type of data associated with this setting. | ||
| * Valid values are 'string', 'boolean', 'integer', 'number', 'array', | ||
| * and 'object'. | ||
| * @type string $group The settings group name the setting was registered in. | ||
| * @type string $label A label of the data attached to this setting. | ||
| * @type string $description A description of the data attached to this setting. | ||
| * @type callable|null $sanitize_callback A callback function that sanitizes the option's value. | ||
| * @type bool|array $show_in_rest Whether data associated with this setting should be included in the | ||
| * REST API. When registering complex settings, this argument may | ||
| * optionally be an array with a 'schema' key. | ||
|
Comment on lines
+3213
to
+3215
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TODO: In the future, document what |
||
| * @type mixed $default Default value when calling `get_option()`. Only present when the | ||
| * setting was registered with a default. | ||
| * } | ||
| * } | ||
| */ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should add the PHPStan type as well, as otherwise this cannot help with static analysis.