From bdae9cd0fdb49a5051f4b01957748a171a9ea584 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 5 Feb 2017 15:15:45 +0000 Subject: [PATCH] Docs: Clarify that `get_the_category_list()` and `the_category()` display links as an unordered list by default. See #39130. git-svn-id: https://develop.svn.wordpress.org/trunk@40043 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/category-template.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/wp-includes/category-template.php b/src/wp-includes/category-template.php index 150ef0a2ef..b4ae6f447a 100644 --- a/src/wp-includes/category-template.php +++ b/src/wp-includes/category-template.php @@ -113,18 +113,19 @@ function get_the_category_by_ID( $cat_ID ) { } /** - * Retrieve category list in either HTML list or custom format. + * Retrieve category list for a post in either HTML list or custom format. * * @since 1.5.1 * * @global WP_Rewrite $wp_rewrite * - * @param string $separator Optional, default is empty string. Separator for between the categories. + * @param string $separator Optional. Separator between the categories. By default, the links are placed + * in an unordered list. An empty string will result in the default behavior. * @param string $parents Optional. How to display the parents. * @param int $post_id Optional. Post ID to retrieve categories. * @return string */ -function get_the_category_list( $separator = '', $parents='', $post_id = false ) { +function get_the_category_list( $separator = '', $parents = '', $post_id = false ) { global $wp_rewrite; if ( ! is_object_in_taxonomy( get_post_type( $post_id ), 'category' ) ) { /** This filter is documented in wp-includes/category-template.php */ @@ -236,15 +237,16 @@ function in_category( $category, $post = null ) { } /** - * Display the category list for the post. + * Display category list for a post in either HTML list or custom format. * * @since 0.71 * - * @param string $separator Optional, default is empty string. Separator for between the categories. + * @param string $separator Optional. Separator between the categories. By default, the links are placed + * in an unordered list. An empty string will result in the default behavior. * @param string $parents Optional. How to display the parents. * @param int $post_id Optional. Post ID to retrieve categories. */ -function the_category( $separator = '', $parents='', $post_id = false ) { +function the_category( $separator = '', $parents = '', $post_id = false ) { echo get_the_category_list( $separator, $parents, $post_id ); }