diff --git a/src/wp-includes/class-wp-post-type.php b/src/wp-includes/class-wp-post-type.php index b53a244d7de84..b37e84768d9f7 100644 --- a/src/wp-includes/class-wp-post-type.php +++ b/src/wp-includes/class-wp-post-type.php @@ -337,6 +337,8 @@ final class WP_Post_Type { /** * Post type capabilities. * + * @see get_post_type_capabilities() + * * @since 4.6.0 * @var stdClass $cap */ diff --git a/src/wp-includes/class-wp-role.php b/src/wp-includes/class-wp-role.php index b9884f206529c..6e09096735bc6 100644 --- a/src/wp-includes/class-wp-role.php +++ b/src/wp-includes/class-wp-role.php @@ -26,8 +26,8 @@ class WP_Role { * List of capabilities the role contains. * * @since 2.0.0 - * @var bool[] Array of key/value pairs where keys represent a capability name and boolean values - * represent whether the role has that capability. + * @var array Array of key/value pairs where keys represent a capability name and + * boolean values represent whether the role has that capability. */ public $capabilities; diff --git a/src/wp-includes/class-wp-taxonomy.php b/src/wp-includes/class-wp-taxonomy.php index 853f6f3d745d1..0c7ffa8c7d6dd 100644 --- a/src/wp-includes/class-wp-taxonomy.php +++ b/src/wp-includes/class-wp-taxonomy.php @@ -160,8 +160,17 @@ final class WP_Taxonomy { /** * Capabilities for this taxonomy. * + * @see register_taxonomy() + * * @since 4.7.0 - * @var stdClass + * @var stdClass { + * Object with all the capabilities as member variables. + * + * @type string $manage_terms Capability to manage terms. Default 'manage_categories'. + * @type string $edit_terms Capability to edit terms. Default 'manage_categories'. + * @type string $delete_terms Capability to delete terms. Default 'manage_categories'. + * @type string $assign_terms Capability to assign terms. Default 'edit_posts'. + * } */ public $cap; diff --git a/src/wp-includes/class-wp-user.php b/src/wp-includes/class-wp-user.php index d921a83de7f1f..e593244e8992b 100644 --- a/src/wp-includes/class-wp-user.php +++ b/src/wp-includes/class-wp-user.php @@ -63,8 +63,8 @@ class WP_User { * Capabilities that the individual user has been granted outside of those inherited from their role. * * @since 2.0.0 - * @var bool[] Array of key/value pairs where keys represent a capability name - * and boolean values represent whether the user has that capability. + * @var array Array of key/value pairs where keys represent a capability name + * and boolean values represent whether the user has that capability. */ public $caps = array(); @@ -88,8 +88,8 @@ class WP_User { * All capabilities the user has, including individual and role based. * * @since 2.0.0 - * @var bool[] Array of key/value pairs where keys represent a capability name - * and boolean values represent whether the user has that capability. + * @var array Array of key/value pairs where keys represent a capability name + * and boolean values represent whether the user has that capability. */ public $allcaps = array(); diff --git a/src/wp-includes/option.php b/src/wp-includes/option.php index 8bd6a1821162e..fb808b7ee4df1 100644 --- a/src/wp-includes/option.php +++ b/src/wp-includes/option.php @@ -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. + * @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. + * @type mixed $default Default value when calling `get_option()`. Only present when the + * setting was registered with a default. * } * } */ diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php index 2db73e9a20476..b61fdd02f42c1 100644 --- a/src/wp-includes/post.php +++ b/src/wp-includes/post.php @@ -2103,56 +2103,6 @@ function _post_type_meta_capabilities( $capabilities = null ) { /** * Builds an object with all post type labels out of a post type object. * - * Accepted keys of the label array in the post type object: - * - * - `name` - General name for the post type, usually plural. The same and overridden - * by `$post_type_object->label`. Default is 'Posts' / 'Pages'. - * - `singular_name` - Name for one object of this post type. Default is 'Post' / 'Page'. - * - `add_new` - Label for adding a new item. Default is 'Add Post' / 'Add Page'. - * - `add_new_item` - Label for adding a new singular item. Default is 'Add Post' / 'Add Page'. - * - `edit_item` - Label for editing a singular item. Default is 'Edit Post' / 'Edit Page'. - * - `new_item` - Label for the new item page title. Default is 'New Post' / 'New Page'. - * - `view_item` - Label for viewing a singular item. Default is 'View Post' / 'View Page'. - * - `view_items` - Label for viewing post type archives. Default is 'View Posts' / 'View Pages'. - * - `search_items` - Label for searching plural items. Default is 'Search Posts' / 'Search Pages'. - * - `not_found` - Label used when no items are found. Default is 'No posts found' / 'No pages found'. - * - `not_found_in_trash` - Label used when no items are in the Trash. Default is 'No posts found in Trash' / - * 'No pages found in Trash'. - * - `parent_item_colon` - Label used to prefix parents of hierarchical items. Not used on non-hierarchical - * post types. Default is 'Parent Page:'. - * - `all_items` - Label to signify all items in a submenu link. Default is 'All Posts' / 'All Pages'. - * - `archives` - Label for archives in nav menus. Default is 'Post Archives' / 'Page Archives'. - * - `attributes` - Label for the attributes meta box. Default is 'Post Attributes' / 'Page Attributes'. - * - `insert_into_item` - Label for the media frame button. Default is 'Insert into post' / 'Insert into page'. - * - `uploaded_to_this_item` - Label for the media frame filter. Default is 'Uploaded to this post' / - * 'Uploaded to this page'. - * - `featured_image` - Label for the featured image meta box title. Default is 'Featured image'. - * - `set_featured_image` - Label for setting the featured image. Default is 'Set featured image'. - * - `remove_featured_image` - Label for removing the featured image. Default is 'Remove featured image'. - * - `use_featured_image` - Label in the media frame for using a featured image. Default is 'Use as featured image'. - * - `menu_name` - Label for the menu name. Default is the same as `name`. - * - `filter_items_list` - Label for the table views hidden heading. Default is 'Filter posts list' / - * 'Filter pages list'. - * - `filter_by_date` - Label for the date filter in list tables. Default is 'Filter by date'. - * - `items_list_navigation` - Label for the table pagination hidden heading. Default is 'Posts list navigation' / - * 'Pages list navigation'. - * - `items_list` - Label for the table hidden heading. Default is 'Posts list' / 'Pages list'. - * - `item_published` - Label used when an item is published. Default is 'Post published.' / 'Page published.' - * - `item_published_privately` - Label used when an item is published with private visibility. - * Default is 'Post published privately.' / 'Page published privately.' - * - `item_reverted_to_draft` - Label used when an item is switched to a draft. - * Default is 'Post reverted to draft.' / 'Page reverted to draft.' - * - `item_trashed` - Label used when an item is moved to Trash. Default is 'Post trashed.' / 'Page trashed.' - * - `item_scheduled` - Label used when an item is scheduled for publishing. Default is 'Post scheduled.' / - * 'Page scheduled.' - * - `item_updated` - Label used when an item is updated. Default is 'Post updated.' / 'Page updated.' - * - `item_link` - Title for a navigation link block variation. Default is 'Post Link' / 'Page Link'. - * - `item_link_description` - Description for a navigation link block variation. Default is 'A link to a post.' / - * 'A link to a page.' - * - * Above, the first default value is for non-hierarchical post types (like posts) - * and the second one is for hierarchical post types (like pages). - * * Note: To set labels used in post type admin notices, see the {@see 'post_updated_messages'} filter. * * @since 3.0.0 @@ -2176,7 +2126,84 @@ function _post_type_meta_capabilities( $capabilities = null ) { * @access private * * @param object|WP_Post_Type $post_type_object Post type object. - * @return object Object with all the labels as member variables. + * @return object { + * Post type labels object. The first default value is for non-hierarchical post types + * (like posts) and the second one is for hierarchical post types (like pages). + * + * @type string $name General name for the post type, usually plural. The same and + * overridden by `$post_type_object->label`. + * Default is 'Posts' / 'Pages'. + * @type string $singular_name Name for one object of this post type. Default is 'Post' / 'Page'. + * @type string $add_new Label for adding a new item. Default is 'Add Post' / 'Add Page'. + * @type string $add_new_item Label for adding a new singular item. + * Default is 'Add Post' / 'Add Page'. + * @type string $edit_item Label for editing a singular item. + * Default is 'Edit Post' / 'Edit Page'. + * @type string $new_item Label for the new item page title. + * Default is 'New Post' / 'New Page'. + * @type string $view_item Label for viewing a singular item. + * Default is 'View Post' / 'View Page'. + * @type string $view_items Label for viewing post type archives. + * Default is 'View Posts' / 'View Pages'. + * @type string $search_items Label for searching plural items. + * Default is 'Search Posts' / 'Search Pages'. + * @type string $not_found Label used when no items are found. + * Default is 'No posts found' / 'No pages found'. + * @type string $not_found_in_trash Label used when no items are in the Trash. + * Default is 'No posts found in Trash' / 'No pages found in Trash'. + * @type string|null $parent_item_colon Label used to prefix parents of hierarchical items. Not used on + * non-hierarchical post types. + * Default is 'Parent Page:'. + * @type string $all_items Label to signify all items in a submenu link. + * Default is 'All Posts' / 'All Pages'. + * @type string $archives Label for archives in nav menus. + * Default is 'Post Archives' / 'Page Archives'. + * @type string $attributes Label for the attributes meta box. + * Default is 'Post Attributes' / 'Page Attributes'. + * @type string $insert_into_item Label for the media frame button. + * Default is 'Insert into post' / 'Insert into page'. + * @type string $uploaded_to_this_item Label for the media frame filter. + * Default is 'Uploaded to this post' / 'Uploaded to this page'. + * @type string $featured_image Label for the featured image meta box title. + * Default is 'Featured image'. + * @type string $set_featured_image Label for setting the featured image. + * Default is 'Set featured image'. + * @type string $remove_featured_image Label for removing the featured image. + * Default is 'Remove featured image'. + * @type string $use_featured_image Label in the media frame for using a featured image. + * Default is 'Use as featured image'. + * @type string $menu_name Label for the menu name. Default is the same as `name`. + * @type string $name_admin_bar Label for the object name in the admin bar. + * Default is the value of `singular_name` in the given labels, or the + * post type key. + * @type string $filter_items_list Label for the table views hidden heading. + * Default is 'Filter posts list' / 'Filter pages list'. + * @type string $filter_by_date Label for the date filter in list tables. + * Default is 'Filter by date'. + * @type string $items_list_navigation Label for the table pagination hidden heading. + * Default is 'Posts list navigation' / 'Pages list navigation'. + * @type string $items_list Label for the table hidden heading. + * Default is 'Posts list' / 'Pages list'. + * @type string $item_published Label used when an item is published. + * Default is 'Post published.' / 'Page published.' + * @type string $item_published_privately Label used when an item is published with private visibility. + * Default is 'Post published privately.' / 'Page published privately.' + * @type string $item_reverted_to_draft Label used when an item is switched to a draft. + * Default is 'Post reverted to draft.' / 'Page reverted to draft.' + * @type string $item_trashed Label used when an item is moved to Trash. + * Default is 'Post trashed.' / 'Page trashed.' + * @type string $item_scheduled Label used when an item is scheduled for publishing. + * Default is 'Post scheduled.' / 'Page scheduled.' + * @type string $item_updated Label used when an item is updated. + * Default is 'Post updated.' / 'Page updated.' + * @type string $item_link Title for a navigation link block variation. + * Default is 'Post Link' / 'Page Link'. + * @type string $item_link_description Description for a navigation link block variation. + * Default is 'A link to a post.' / 'A link to a page.' + * @type string $template_name Label for the single item template. Only set when the post type is + * given a `singular_name` label. + * Default is 'Single item: ' followed by the singular name. + * } */ function get_post_type_labels( $post_type_object ) { $nohier_vs_hier_defaults = WP_Post_Type::get_default_labels(); diff --git a/src/wp-includes/taxonomy.php b/src/wp-includes/taxonomy.php index 29317f0a8bf9b..9d82fba3d9d46 100644 --- a/src/wp-includes/taxonomy.php +++ b/src/wp-includes/taxonomy.php @@ -652,56 +652,60 @@ function unregister_taxonomy( $taxonomy ) { * Taxonomy labels object. The first default value is for non-hierarchical taxonomies * (like tags) and the second one is for hierarchical taxonomies (like categories). * - * @type string $name General name for the taxonomy, usually plural. The same - * as and overridden by `$tax->label`. Default 'Tags'/'Categories'. - * @type string $singular_name Name for one object of this taxonomy. Default 'Tag'/'Category'. - * @type string $search_items Default 'Search Tags'/'Search Categories'. - * @type string $popular_items This label is only used for non-hierarchical taxonomies. - * Default 'Popular Tags'. - * @type string $all_items Default 'All Tags'/'All Categories'. - * @type string $parent_item This label is only used for hierarchical taxonomies. Default - * 'Parent Category'. - * @type string $parent_item_colon The same as `parent_item`, but with colon `:` in the end. - * @type string $name_field_description Description for the Name field on Edit Tags screen. - * Default 'The name is how it appears on your site'. - * @type string $slug_field_description Description for the Slug field on Edit Tags screen. - * Default 'The “slug” is the URL-friendly version - * of the name. It is usually all lowercase and contains - * only letters, numbers, and hyphens'. - * @type string $parent_field_description Description for the Parent field on Edit Tags screen. - * Default 'Assign a parent term to create a hierarchy. - * The term Jazz, for example, would be the parent - * of Bebop and Big Band'. - * @type string $desc_field_description Description for the Description field on Edit Tags screen. - * Default 'The description is not prominent by default; - * however, some themes may show it'. - * @type string $edit_item Default 'Edit Tag'/'Edit Category'. - * @type string $view_item Default 'View Tag'/'View Category'. - * @type string $update_item Default 'Update Tag'/'Update Category'. - * @type string $add_new_item Default 'Add Tag'/'Add Category'. - * @type string $new_item_name Default 'New Tag Name'/'New Category Name'. - * @type string $template_name Default 'Tag Archives'/'Category Archives'. - * @type string $separate_items_with_commas This label is only used for non-hierarchical taxonomies. Default - * 'Separate tags with commas', used in the meta box. - * @type string $add_or_remove_items This label is only used for non-hierarchical taxonomies. Default - * 'Add or remove tags', used in the meta box when JavaScript - * is disabled. - * @type string $choose_from_most_used This label is only used on non-hierarchical taxonomies. Default - * 'Choose from the most used tags', used in the meta box. - * @type string $not_found Default 'No tags found'/'No categories found', used in - * the meta box and taxonomy list table. - * @type string $no_terms Default 'No tags'/'No categories', used in the posts and media - * list tables. - * @type string $filter_by_item This label is only used for hierarchical taxonomies. Default - * 'Filter by category', used in the posts list table. - * @type string $items_list_navigation Label for the table pagination hidden heading. - * @type string $items_list Label for the table hidden heading. - * @type string $most_used Title for the Most Used tab. Default 'Most Used'. - * @type string $back_to_items Label displayed after a term has been updated. - * @type string $item_link Used in the block editor. Title for a navigation link block variation. - * Default 'Tag Link'/'Category Link'. - * @type string $item_link_description Used in the block editor. Description for a navigation link block - * variation. Default 'A link to a tag'/'A link to a category'. + * @type string $name General name for the taxonomy, usually plural. The same + * as and overridden by `$tax->label`. Default 'Tags'/'Categories'. + * @type string $singular_name Name for one object of this taxonomy. Default 'Tag'/'Category'. + * @type string $menu_name Label for the menu name. Default 'Tags'/'Categories'. + * @type string $name_admin_bar Label for the object name in the admin bar. Default is the value of + * `singular_name` in the given labels, or the taxonomy key. + * @type string $search_items Default 'Search Tags'/'Search Categories'. + * @type string|null $popular_items This label is only used for non-hierarchical taxonomies. + * Default 'Popular Tags'. + * @type string $all_items Default 'All Tags'/'All Categories'. + * @type string|null $parent_item This label is only used for hierarchical taxonomies. Default + * 'Parent Category'. + * @type string|null $parent_item_colon This label is only used for hierarchical taxonomies. The same as + * `parent_item`, but with colon `:` in the end. + * @type string $name_field_description Description for the Name field on Edit Tags screen. + * Default 'The name is how it appears on your site'. + * @type string $slug_field_description Description for the Slug field on Edit Tags screen. + * Default 'The “slug” is the URL-friendly version + * of the name. It is usually all lowercase and contains + * only letters, numbers, and hyphens'. + * @type string|null $parent_field_description Description for the Parent field on Edit Tags screen. + * Default 'Assign a parent term to create a hierarchy. + * The term Jazz, for example, would be the parent + * of Bebop and Big Band'. + * @type string $desc_field_description Description for the Description field on Edit Tags screen. + * Default 'The description is not prominent by default; + * however, some themes may show it'. + * @type string $edit_item Default 'Edit Tag'/'Edit Category'. + * @type string $view_item Default 'View Tag'/'View Category'. + * @type string $update_item Default 'Update Tag'/'Update Category'. + * @type string $add_new_item Default 'Add Tag'/'Add Category'. + * @type string $new_item_name Default 'New Tag Name'/'New Category Name'. + * @type string $template_name Default 'Tag Archives'/'Category Archives'. + * @type string|null $separate_items_with_commas This label is only used for non-hierarchical taxonomies. Default + * 'Separate tags with commas', used in the meta box. + * @type string|null $add_or_remove_items This label is only used for non-hierarchical taxonomies. Default + * 'Add or remove tags', used in the meta box when JavaScript + * is disabled. + * @type string|null $choose_from_most_used This label is only used on non-hierarchical taxonomies. Default + * 'Choose from the most used tags', used in the meta box. + * @type string $not_found Default 'No tags found'/'No categories found', used in + * the meta box and taxonomy list table. + * @type string $no_terms Default 'No tags'/'No categories', used in the posts and media + * list tables. + * @type string|null $filter_by_item This label is only used for hierarchical taxonomies. Default + * 'Filter by category', used in the posts list table. + * @type string $items_list_navigation Label for the table pagination hidden heading. + * @type string $items_list Label for the table hidden heading. + * @type string $most_used Title for the Most Used tab. Default 'Most Used'. + * @type string $back_to_items Label displayed after a term has been updated. + * @type string $item_link Used in the block editor. Title for a navigation link block + * variation. Default 'Tag Link'/'Category Link'. + * @type string $item_link_description Used in the block editor. Description for a navigation link block + * variation. Default 'A link to a tag'/'A link to a category'. * } */ function get_taxonomy_labels( $tax ) {