WordPress.org

Make WordPress Core

Ticket #41108: 41108.diff

File 41108.diff, 5.5 KB (added by truongwp, 2 years ago)
  • src/wp-includes/taxonomy.php

     
    447447}
    448448
    449449/**
    450  * Builds an object with all taxonomy labels out of a taxonomy object
     450 * Builds an object with all taxonomy labels out of a taxonomy object.
    451451 *
    452  * Accepted keys of the label array in the taxonomy object:
    453  *
    454  * - name - general name for the taxonomy, usually plural. The same as and overridden by $tax->label. Default is Tags/Categories
    455  * - singular_name - name for one object of this taxonomy. Default is Tag/Category
    456  * - search_items - Default is Search Tags/Search Categories
    457  * - popular_items - This string isn't used on hierarchical taxonomies. Default is Popular Tags
    458  * - all_items - Default is All Tags/All Categories
    459  * - parent_item - This string isn't used on non-hierarchical taxonomies. In hierarchical ones the default is Parent Category
    460  * - parent_item_colon - The same as `parent_item`, but with colon `:` in the end
    461  * - edit_item - Default is Edit Tag/Edit Category
    462  * - view_item - Default is View Tag/View Category
    463  * - update_item - Default is Update Tag/Update Category
    464  * - add_new_item - Default is Add New Tag/Add New Category
    465  * - new_item_name - Default is New Tag Name/New Category Name
    466  * - separate_items_with_commas - This string isn't used on hierarchical taxonomies. Default is "Separate tags with commas", used in the meta box.
    467  * - 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.
    468  * - 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.
    469  * - not_found - Default is "No tags found"/"No categories found", used in the meta box and taxonomy list table.
    470  * - no_terms - Default is "No tags"/"No categories", used in the posts and media list tables.
    471  * - items_list_navigation - String for the table pagination hidden heading.
    472  * - items_list - String for the table hidden heading.
    473  *
    474  * Above, the first default value is for non-hierarchical taxonomies (like tags) and the second one is for hierarchical taxonomies (like categories).
    475  *
    476  * @todo Better documentation for the labels array.
    477  *
    478452 * @since 3.0.0
    479453 * @since 4.3.0 Added the `no_terms` label.
    480454 * @since 4.4.0 Added the `items_list_navigation` and `items_list` labels.
    481455 *
    482  * @param WP_Taxonomy $tax Taxonomy object.
     456 * @param WP_Taxonomy $tax {
     457 *     Taxonomy object. The `labels` property accepts keys of the label array in the taxonomy object.
     458 *
     459 *     @type string $name                       General name for the taxonomy, usually plural. The same as and
     460 *                                              overridden by $tax->label. Default is Tags/Categories.
     461 *     @type string $singular_name              Name for one object of this taxonomy. Default is Tag/Category.
     462 *     @type string $search_items               Default is Search Tags/Search Categories.
     463 *     @type string $popular_items              This string isn't used on hierarchical taxonomies. Default is
     464 *                                              Popular Tags.
     465 *     @type string $all_items                  Default is All Tags/All Categories.
     466 *     @type string $parent_item                This string isn't used on non-hierarchical taxonomies. In hierarchical
     467 *                                              ones the default is Parent Category.
     468 *     @type string $parent_item_colon          The same as `parent_item`, but with colon `:` in the end.
     469 *     @type string $edit_item                  Default is Edit Tag/Edit Category.
     470 *     @type string $view_item                  Default is View Tag/View Category.
     471 *     @type string $update_item                Default is Update Tag/Update Category.
     472 *     @type string $add_new_item               Default is Add New Tag/Add New Category.
     473 *     @type string $new_item_name              Default is New Tag Name/New Category Name.
     474 *     @type string $separate_items_with_commas This string isn't used on hierarchical taxonomies. Default is
     475 *                                              "Separate tags with commas", used in the meta box.
     476 *     @type string $add_or_remove_items        This string isn't used on hierarchical taxonomies. Default is
     477 *                                              "Add or remove tags", used in the meta box when JavaScript is disabled.
     478 *     @type string $choose_from_most_used      This string isn't used on hierarchical taxonomies. Default is
     479 *                                              "Choose from the most used tags", used in the meta box.
     480 *     @type string $not_found                  Default is "No tags found"/"No categories found", used in the meta box
     481 *                                              and taxonomy list table.
     482 *     @type string $no_terms                   Default is "No tags"/"No categories", used in the posts and media
     483 *                                              list tables.
     484 *     @type string $items_list_navigation      String for the table pagination hidden heading.
     485 *     @type string $items_list                 String for the table hidden heading.
     486 *
     487 *     Above, the first default value is for non-hierarchical taxonomies (like tags) and the second one is for
     488 *     hierarchical taxonomies (like categories).
     489 * }
    483490 * @return object object with all the labels as member variables.
    484491 */
    485492function get_taxonomy_labels( $tax ) {