WordPress.org

Make WordPress Core

Changeset 40944


Ignore:
Timestamp:
06/25/2017 09:41:09 PM (2 years ago)
Author:
DrewAPicture
Message:

Docs: Add full documentation for members in the labels object returned by get_taxonomy_labels().

Props truongwp.
Fixes #41108.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/taxonomy.php

    r40921 r40944  
    448448
    449449/**
    450  * Builds an object with all taxonomy labels out of a taxonomy object
    451  *
    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.
     450 * Builds an object with all taxonomy labels out of a taxonomy object.
    477451 *
    478452 * @since 3.0.0
     
    481455 *
    482456 * @param WP_Taxonomy $tax Taxonomy object.
    483  * @return object object with all the labels as member variables.
     457 * @return object {
     458 *     Taxonomy labels object. The first default value is for non-hierarchical taxonomies
     459 *     (like tags) and the second one is for hierarchical taxonomies (like categories).
     460 *
     461 *     @type string $name                       General name for the taxonomy, usually plural. The same
     462 *                                              as and overridden by `$tax->label`. Default 'Tags'/'Categories'.
     463 *     @type string $singular_name              Name for one object of this taxonomy. Default 'Tag'/'Category'.
     464 *     @type string $search_items               Default 'Search Tags'/'Search Categories'.
     465 *     @type string $popular_items              This label is only used for non-hierarchical taxonomies.
     466 *                                              Default 'Popular Tags'.
     467 *     @type string $all_items                  Default 'All Tags'/'All Categories'.
     468 *     @type string $parent_item                This label is only used for hierarchical taxonomies. Default
     469 *                                              'Parent Category'.
     470 *     @type string $parent_item_colon          The same as `parent_item`, but with colon `:` in the end.
     471 *     @type string $edit_item                  Default 'Edit Tag'/'Edit Category'.
     472 *     @type string $view_item                  Default 'View Tag'/'View Category'.
     473 *     @type string $update_item                Default 'Update Tag'/'Update Category'.
     474 *     @type string $add_new_item               Default 'Add New Tag'/'Add New Category'.
     475 *     @type string $new_item_name              Default 'New Tag Name'/'New Category Name'.
     476 *     @type string $separate_items_with_commas This label is only used for non-hierarchical taxonomies. Default
     477 *                                              'Separate tags with commas', used in the meta box.
     478 *     @type string $add_or_remove_items        This label is only used for non-hierarchical taxonomies. Default
     479 *                                              'Add or remove tags', used in the meta box when JavaScript
     480 *                                              is disabled.
     481 *     @type string $choose_from_most_used      This label is only used on non-hierarchical taxonomies. Default
     482 *                                              'Choose from the most used tags', used in the meta box.
     483 *     @type string $not_found                  Default 'No tags found'/'No categories found', used in
     484 *                                              the meta box and taxonomy list table.
     485 *     @type string $no_terms                   Default 'No tags'/'No categories', used in the posts and media
     486 *                                              list tables.
     487 *     @type string $items_list_navigation      Label for the table pagination hidden heading.
     488 *     @type string $items_list                 Label for the table hidden heading.
     489 * }
    484490 */
    485491function get_taxonomy_labels( $tax ) {
Note: See TracChangeset for help on using the changeset viewer.