WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/05/2017 03:15:45 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Docs: Clarify that get_the_category_list() and the_category() display links as an unordered list by default.

See #39130.

File:
1 edited

Legend:

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

    r40028 r40043  
    114114
    115115/**
    116  * Retrieve category list in either HTML list or custom format.
     116 * Retrieve category list for a post in either HTML list or custom format.
    117117 *
    118118 * @since 1.5.1
     
    120120 * @global WP_Rewrite $wp_rewrite
    121121 *
    122  * @param string $separator Optional, default is empty string. Separator for between the categories.
     122 * @param string $separator Optional. Separator between the categories. By default, the links are placed
     123 *                          in an unordered list. An empty string will result in the default behavior.
    123124 * @param string $parents Optional. How to display the parents.
    124125 * @param int $post_id Optional. Post ID to retrieve categories.
    125126 * @return string
    126127 */
    127 function get_the_category_list( $separator = '', $parents='', $post_id = false ) {
     128function get_the_category_list( $separator = '', $parents = '', $post_id = false ) {
    128129    global $wp_rewrite;
    129130    if ( ! is_object_in_taxonomy( get_post_type( $post_id ), 'category' ) ) {
     
    237238
    238239/**
    239  * Display the category list for the post.
     240 * Display category list for a post in either HTML list or custom format.
    240241 *
    241242 * @since 0.71
    242243 *
    243  * @param string $separator Optional, default is empty string. Separator for between the categories.
     244 * @param string $separator Optional. Separator between the categories. By default, the links are placed
     245 *                          in an unordered list. An empty string will result in the default behavior.
    244246 * @param string $parents Optional. How to display the parents.
    245247 * @param int $post_id Optional. Post ID to retrieve categories.
    246248 */
    247 function the_category( $separator = '', $parents='', $post_id = false ) {
     249function the_category( $separator = '', $parents = '', $post_id = false ) {
    248250    echo get_the_category_list( $separator, $parents, $post_id );
    249251}
Note: See TracChangeset for help on using the changeset viewer.