WordPress.org

Make WordPress Core

#49181 closed defect (bug) (fixed)

Clarify accepted values for style argument in wp_list_comments()

Reported by: jeremyfelt Owned by: SergeyBiryukov
Milestone: 5.5 Priority: normal
Severity: normal Version:
Component: Comments Keywords: good-first-bug has-patch
Focuses: docs Cc:

Description

wp_list_comments() accepts style as part of the arguments it passes to the comment walker to determine how a list of comments should be displayed.

  • If div is passed, no markup is output in the walker's start_lvl() method.
  • If ol is passed, ol markup is output.
  • If ul or any other value is passed, ul markup is output.

The functions docs imply right now that only ol and ul are valid. It should clarify that div will result in no additional list markup.

Attachments (1)

00000.diff (1.0 KB) - added by liuhaibin 17 months ago.

Download all attachments as: .zip

Change History (7)

#1 @functionalrhyme
17 months ago

The documentation can be found here:
https://developer.wordpress.org/reference/functions/wp_list_comments/#comments

The code is here:
wp-includes/class-walker-comment.php#L58

@liuhaibin
17 months ago

#2 @liuhaibin
17 months ago

I've attached the patch. My very first one. Please take a look. Thanks.

#3 @SergeyBiryukov
17 months ago

  • Keywords has-patch added; needs-patch removed
  • Milestone changed from Awaiting Review to 5.5
  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

#4 @liuhaibin
17 months ago

I should have named the patched as 49181.diff. But to avoid duplication, I did not upload the same patch again with another name.

#5 @liuhaibin
16 months ago

Hi, is there anything that I can do to move the ticket forward?

#6 @SergeyBiryukov
12 months ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 48597:

Docs: Improve documentation for wp_list_comments().

Note that passing div to the style parameter will result in no additional list markup.

Props liuhaibin, jeremyfelt, functionalrhyme.
Fixes #49181.

Note: See TracTickets for help on using tickets.