From a3fb39bc51a6a721d67c35f9dbd1fec6b7600785 Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Sun, 25 Jun 2017 21:41:09 +0000 Subject: [PATCH] Docs: Add full documentation for members in the labels object returned by get_taxonomy_labels(). Props truongwp. Fixes #41108. git-svn-id: https://develop.svn.wordpress.org/trunk@40944 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/taxonomy.php | 62 ++++++++++++++++++++---------------- 1 file changed, 34 insertions(+), 28 deletions(-) diff --git a/src/wp-includes/taxonomy.php b/src/wp-includes/taxonomy.php index 1a0d170848..e557e81d46 100644 --- a/src/wp-includes/taxonomy.php +++ b/src/wp-includes/taxonomy.php @@ -447,40 +447,46 @@ function unregister_taxonomy( $taxonomy ) { } /** - * Builds an object with all taxonomy labels out of a taxonomy object - * - * Accepted keys of the label array in the taxonomy object: - * - * - name - general name for the taxonomy, usually plural. The same as and overridden by $tax->label. Default is Tags/Categories - * - singular_name - name for one object of this taxonomy. Default is Tag/Category - * - search_items - Default is Search Tags/Search Categories - * - popular_items - This string isn't used on hierarchical taxonomies. Default is Popular Tags - * - all_items - Default is All Tags/All Categories - * - parent_item - This string isn't used on non-hierarchical taxonomies. In hierarchical ones the default is Parent Category - * - parent_item_colon - The same as `parent_item`, but with colon `:` in the end - * - edit_item - Default is Edit Tag/Edit Category - * - view_item - Default is View Tag/View Category - * - update_item - Default is Update Tag/Update Category - * - add_new_item - Default is Add New Tag/Add New Category - * - new_item_name - Default is New Tag Name/New Category Name - * - separate_items_with_commas - This string isn't used on hierarchical taxonomies. Default is "Separate tags with commas", used in the meta box. - * - add_or_remove_items - This string isn't used on hierarchical taxonomies. Default is "Add or remove tags", used in the meta box when JavaScript is disabled. - * - choose_from_most_used - This string isn't used on hierarchical taxonomies. Default is "Choose from the most used tags", used in the meta box. - * - not_found - Default is "No tags found"/"No categories found", used in the meta box and taxonomy list table. - * - no_terms - Default is "No tags"/"No categories", used in the posts and media list tables. - * - items_list_navigation - String for the table pagination hidden heading. - * - items_list - String for the table hidden heading. - * - * Above, the first default value is for non-hierarchical taxonomies (like tags) and the second one is for hierarchical taxonomies (like categories). - * - * @todo Better documentation for the labels array. + * Builds an object with all taxonomy labels out of a taxonomy object. * * @since 3.0.0 * @since 4.3.0 Added the `no_terms` label. * @since 4.4.0 Added the `items_list_navigation` and `items_list` labels. * * @param WP_Taxonomy $tax Taxonomy object. - * @return object object with all the labels as member variables. + * @return object { + * 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 $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 New Tag'/'Add New Category'. + * @type string $new_item_name Default 'New Tag Name'/'New Category Name'. + * @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 $items_list_navigation Label for the table pagination hidden heading. + * @type string $items_list Label for the table hidden heading. + * } */ function get_taxonomy_labels( $tax ) { $tax->labels = (array) $tax->labels;