wppaste
WordPress

wp_list_comments( string|array $args = array(), WP_Comment[] $comments = null ): void|string

Since
2.7.0
Source
wp-includes/comment-template.php:2234
Displays a list of comments.

Description

Used in the comments.php template to list comments for a particular post.

Compatibility

WordPress
since 2.7.0
PHP
7.4–8.6-dev
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0), and compiles on PHP 7.4 through 8.6-dev.

Parameters

$argsstring|arrayoptional
Formatting options.Default: array()
  • $walkerobjectdefault: null

    Instance of a Walker class to list comments.
  • $max_depthintdefault: empty

    The maximum comments depth.
  • $stylestringdefault: 'ul'

    The style of list ordering. Accepts 'ul', 'ol', or 'div'. 'div' will result in no additional list markup.
  • $callbackcallabledefault: null

    Callback function to use.
  • $endcallabledefault: null

    -callback Callback function to use at the end.
  • $typestringdefault: 'all'

    Type of comments to list. Accepts 'all', 'comment', 'pingback', 'trackback', 'pings'.
  • $pageintdefault: empty

    Page ID to list comments for.
  • $per_pageintdefault: empty

    Number of comments to list per page.
  • $avatar_sizeintdefault: 32

    Height and width dimensions of the avatar size.
  • $reverse_top_levelbooldefault: null

    Ordering of the listed comments. If true, will display newest comments first.
  • $reverse_childrenbooldefault: null

    Whether to reverse child comments in the list.
  • $formatstringdefault: 'html5' if the theme supports it

    How to format the comments list. Accepts 'html5', 'xhtml'.
  • $short_pingbooldefault: false

    Whether to output short pings.
  • $echobooldefault: true

    Whether to echo the output or return it.
$commentsWP_Comment[]optional
Array of WP_Comment objects. Default null.Default: null

Return value

void|string
Void if 'echo' argument is true, or no comments to list.
Otherwise, HTML list of comments.

Performance profile

How much work a call to wp_list_comments() does, and what it touches: the algorithmic scaling, the Zend instruction count per call across PHP versions, the hooks it hands control to, and the core code that calls it. Measured from the compiled opcodes, not a stopwatch, so every number is identical on any machine running the same PHP version, and every function in core is ranked by cost.

Cost class
Heavy

Reaches the database via get_comments().

Scaling
Constant

No loop in the body: the same number of instructions runs whatever you pass in.

Instructions
89–202

Executed per call on PHP 8.5, depending on the branch taken. The body compiles to 314.

Plugin surface
1 hook

Third-party callbacks on 'wp_list_comments_args' run inside this call, and their cost is not bounded by anything here.

Called by
0

Nothing in core calls this; the cost is only what you spend yourself.

What it touches

  • hookthird-party callbacksapply_filters()called directly
  • optionoption read or writeget_option()called directly
  • querycontent queryget_comments()called directly
  • cacheobject cachewp_cache_get()one call below wp_list_comments()
  • serializeserialisationmaybe_unserialize()one call below wp_list_comments()

Further down the call graph this can also reach transient. That is the worst case, several calls deep and usually down an error path, not what a normal call pays.

What one call costs · 99 distinct outcomes

One number would be a lie: the work depends on which branch runs. These are every distinct cost wp_list_comments() can have, taken from its control-flow graph on PHP 8.5.

WhenInstructionsCalls it makes
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && empty($comments_by_type)89current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in()129–145current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in()133–151current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && empty($overridden_cpage)137–153current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_query_var(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type)137–150current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in()138–159current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), get_query_var(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in()139–157current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type)141–156current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && empty($overridden_cpage)143–159current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_query_var(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in()143–161current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), get_option(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in()144–165current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), get_query_var(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type) && empty($overridden_cpage)145–158current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_query_var(), ->paged_walk()
87 further outcomes, up to 202 instructions
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && get_option() && empty($overridden_cpage)146–159current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), get_query_var(), get_query_var(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type)146–164current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), get_query_var(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && empty($overridden_cpage)147–160current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), get_option(), get_query_var(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type)147–162current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($overridden_cpage)148–164current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), set_query_var(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && get_option()148–163current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), get_query_var(), get_option(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in()149–162current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), get_option(), get_option(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type) && empty($overridden_cpage)151–164current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_query_var(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && empty($overridden_cpage)151–164current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), get_option(), get_option(), get_query_var(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type)151–166current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), get_option(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !get_option() && !empty($overridden_cpage)152–170current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), get_option(), set_query_var(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && get_option() && empty($overridden_cpage)152–165current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), get_query_var(), get_query_var(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && empty($overridden_cpage)152–165current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), get_query_var(), get_option(), get_query_var(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type)152–170current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), get_query_var(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && empty($overridden_cpage)153–166current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), get_option(), get_query_var(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($overridden_cpage)154–170current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), set_query_var(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type) && get_option() && empty($overridden_cpage)154–167current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), get_query_var(), get_query_var(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && get_option()154–167current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), get_query_var(), get_option(), get_option(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type) && empty($overridden_cpage)155–168current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), get_option(), get_query_var(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($overridden_cpage)156–172current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), get_comment_pages_count(), set_query_var(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type) && !empty($overridden_cpage)156–169current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), set_query_var(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && get_option() && empty($overridden_cpage)156–169current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), get_query_var(), get_option(), get_option(), get_query_var(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type) && get_option()156–171current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), get_query_var(), get_option(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && get_option() && !empty($overridden_cpage)157–170current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), get_query_var(), get_option(), set_query_var(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && empty($overridden_cpage)157–170current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), get_option(), get_option(), get_query_var(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type)157–170current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), get_option(), get_option(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !get_option() && !empty($overridden_cpage)158–176current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), get_option(), set_query_var(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($overridden_cpage)158–174current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), get_option(), get_option(), set_query_var(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && empty($overridden_cpage)158–171current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), get_query_var(), get_option(), get_query_var(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type) && empty($overridden_cpage)159–172current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), get_option(), get_option(), get_query_var(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !get_option() && !empty($overridden_cpage)160–178current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), get_option(), get_comment_pages_count(), set_query_var(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type) && !get_option() && !empty($overridden_cpage)160–175current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), get_option(), set_query_var(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type) && get_option() && empty($overridden_cpage)160–173current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), get_query_var(), get_query_var(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type) && empty($overridden_cpage)160–173current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), get_query_var(), get_option(), get_query_var(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type) && empty($overridden_cpage)161–174current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), get_option(), get_query_var(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($overridden_cpage)162–178current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), get_comment_pages_count(), set_query_var(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type) && !empty($overridden_cpage)162–175current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), set_query_var(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($overridden_cpage)162–175current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), get_option(), get_option(), get_option(), set_query_var(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && get_option() && empty($overridden_cpage)162–175current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), get_query_var(), get_option(), get_option(), get_query_var(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type) && get_option()162–175current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), get_query_var(), get_option(), get_option(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && get_option() && !empty($overridden_cpage)163–176current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), get_query_var(), get_option(), set_query_var(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($overridden_cpage)163–176current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), get_query_var(), get_option(), get_option(), set_query_var(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type) && !empty($overridden_cpage)164–177current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), get_comment_pages_count(), set_query_var(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($overridden_cpage)164–180current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), get_option(), get_option(), set_query_var(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type) && get_option() && empty($overridden_cpage)164–177current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), get_query_var(), get_option(), get_option(), get_query_var(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && get_option() && !empty($overridden_cpage)165–178current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), get_query_var(), get_option(), get_comment_pages_count(), set_query_var(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type) && get_option() && !empty($overridden_cpage)165–178current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), get_query_var(), get_option(), set_query_var(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type) && empty($overridden_cpage)165–178current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), get_option(), get_option(), get_query_var(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !get_option() && !empty($overridden_cpage)166–184current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), get_option(), get_comment_pages_count(), set_query_var(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($overridden_cpage)166–180current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), get_option(), get_option(), get_comment_pages_count(), set_query_var(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type) && !get_option() && !empty($overridden_cpage)166–181current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), get_option(), set_query_var(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type) && !empty($overridden_cpage)166–179current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), get_option(), get_option(), set_query_var(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type) && empty($overridden_cpage)166–179current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), get_query_var(), get_option(), get_query_var(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && get_option() && !empty($overridden_cpage)167–180current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), get_query_var(), get_option(), get_option(), get_option(), set_query_var(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type) && !get_option() && !empty($overridden_cpage)168–183current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), get_option(), get_comment_pages_count(), set_query_var(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($overridden_cpage)168–181current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), get_option(), get_option(), get_option(), set_query_var(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($overridden_cpage)169–182current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), get_query_var(), get_option(), get_option(), set_query_var(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type) && !empty($overridden_cpage)170–183current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), get_comment_pages_count(), set_query_var(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($overridden_cpage)170–183current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), get_option(), get_option(), get_option(), get_comment_pages_count(), set_query_var(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type) && !empty($overridden_cpage)170–183current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), get_option(), get_option(), get_option(), set_query_var(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type) && get_option() && empty($overridden_cpage)170–183current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), get_query_var(), get_option(), get_option(), get_query_var(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && get_option() && !empty($overridden_cpage)171–184current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), get_query_var(), get_option(), get_comment_pages_count(), set_query_var(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($overridden_cpage)171–184current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), get_query_var(), get_option(), get_option(), get_comment_pages_count(), set_query_var(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type) && get_option() && !empty($overridden_cpage)171–184current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), get_query_var(), get_option(), set_query_var(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type) && !empty($overridden_cpage)171–184current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), get_query_var(), get_option(), get_option(), set_query_var(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($overridden_cpage)172–185current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), get_option(), get_option(), get_comment_pages_count(), set_query_var(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type) && !empty($overridden_cpage)172–185current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), get_option(), get_option(), set_query_var(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type) && get_option() && !empty($overridden_cpage)173–186current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), get_query_var(), get_option(), get_comment_pages_count(), set_query_var(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && get_option() && !empty($overridden_cpage)173–186current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), get_query_var(), get_option(), get_option(), get_option(), set_query_var(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type) && !get_option() && !empty($overridden_cpage)174–189current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), get_option(), get_comment_pages_count(), set_query_var(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type) && !empty($overridden_cpage)174–187current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), get_option(), get_option(), get_comment_pages_count(), set_query_var(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && get_option() && !empty($overridden_cpage)175–188current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), get_query_var(), get_option(), get_option(), get_option(), get_comment_pages_count(), set_query_var(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type) && get_option() && !empty($overridden_cpage)175–188current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), get_query_var(), get_option(), get_option(), get_option(), set_query_var(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($overridden_cpage)176–189current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), get_option(), get_option(), get_option(), get_comment_pages_count(), set_query_var(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type) && !empty($overridden_cpage)176–189current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), get_option(), get_option(), get_option(), set_query_var(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($overridden_cpage)177–190current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), get_query_var(), get_option(), get_option(), get_comment_pages_count(), set_query_var(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type) && !empty($overridden_cpage)177–190current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), get_query_var(), get_option(), get_option(), set_query_var(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type) && !empty($overridden_cpage)178–191current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), get_option(), get_option(), get_option(), get_comment_pages_count(), set_query_var(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type) && get_option() && !empty($overridden_cpage)179–192current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), get_query_var(), get_option(), get_comment_pages_count(), set_query_var(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type) && !empty($overridden_cpage)179–192current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), get_query_var(), get_option(), get_option(), get_comment_pages_count(), set_query_var(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type) && !empty($overridden_cpage)180–193current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), get_option(), get_option(), get_comment_pages_count(), set_query_var(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && get_option() && !empty($overridden_cpage)181–194current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), get_option(), get_query_var(), get_option(), get_option(), get_option(), get_comment_pages_count(), set_query_var(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type) && get_option() && !empty($overridden_cpage)181–194current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), get_query_var(), get_option(), get_option(), get_option(), set_query_var(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type) && get_option() && !empty($overridden_cpage)183–196current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), get_query_var(), get_option(), get_option(), get_option(), get_comment_pages_count(), set_query_var(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type) && !empty($overridden_cpage)184–197current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), get_option(), get_option(), get_option(), get_comment_pages_count(), set_query_var(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type) && !empty($overridden_cpage)185–198current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), get_query_var(), get_option(), get_option(), get_comment_pages_count(), set_query_var(), get_option(), ->paged_walk()
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && !empty($comments_by_type) && get_option() && !empty($overridden_cpage)189–202current_theme_supports(), wp_parse_args(), apply_filters(), get_query_var(), get_query_var(), get_the_ID(), is_user_logged_in(), wp_get_unapproved_comment_author_email(), get_comments(), separate_comments(), get_option(), get_query_var(), get_option(), get_option(), get_option(), get_comment_pages_count(), set_query_var(), get_option(), ->paged_walk()

This body has more branch combinations than are worth enumerating, so the table covers the outcomes found first rather than every one that exists.

Across PHP versions

PHPCompiledExecutedBranchesNotes
8.6-dev31389–201351 fewer instruction than PHP 8.5
8.531489–20235
8.431489–20235
8.331489–20235
8.231489–20235
8.131489–202351 fewer instruction than PHP 7.4
7.431589–20235

An instruction is not a fixed amount of time, so a matching count is not necessarily the same speed; what it rules out is a difference in the work itself.

Hooks and filters fired · 1

One hook fires while wp_list_comments() runs, in this order:

  1. apply_filters( wp_list_comments_args )filterline 2271 (+37 into the body)

    Filters the arguments used in retrieving the comment list.

Uses · 14

Show all 14
  • set_query_var()Sets the value of a query variable in the WP_Query class.
  • Walker_Comment::__construct()

Source code

function wp_list_comments( $args = array(), $comments = null ) {	global $wp_query, $comment_alt, $comment_depth, $comment_thread_alt, $overridden_cpage, $in_comment_loop; 	$in_comment_loop = true; 	$comment_alt        = 0;	$comment_thread_alt = 0;	$comment_depth      = 1; 	$defaults = array(		'walker'            => null,		'max_depth'         => '',		'style'             => 'ul',		'callback'          => null,		'end-callback'      => null,		'type'              => 'all',		'page'              => '',		'per_page'          => '',		'avatar_size'       => 32,		'reverse_top_level' => null,		'reverse_children'  => '',		'format'            => current_theme_supports( 'html5', 'comment-list' ) ? 'html5' : 'xhtml',		'short_ping'        => false,		'echo'              => true,	); 	$parsed_args = wp_parse_args( $args, $defaults ); 	/**	 * Filters the arguments used in retrieving the comment list.	 *	 * @since 4.0.0	 *	 * @see wp_list_comments()	 *	 * @param array $parsed_args An array of arguments for displaying comments.	 */	$parsed_args = apply_filters( 'wp_list_comments_args', $parsed_args ); 	// Figure out what comments we'll be looping through ($_comments).	if ( null !== $comments ) {		$comments = (array) $comments;		if ( empty( $comments ) ) {			return;		}		if ( 'all' !== $parsed_args['type'] ) {			$comments_by_type = separate_comments( $comments );			if ( empty( $comments_by_type[ $parsed_args['type'] ] ) ) {				return;			}			$_comments = $comments_by_type[ $parsed_args['type'] ];		} else {			$_comments = $comments;		}	} else {		/*		 * If 'page' or 'per_page' has been passed, and does not match what's in $wp_query,		 * perform a separate comment query and allow Walker_Comment to paginate.		 */		if ( $parsed_args['page'] || $parsed_args['per_page'] ) {			$current_cpage = (int) get_query_var( 'cpage' );			if ( ! $current_cpage ) {				$current_cpage = 'newest' === get_option( 'default_comments_page' ) ? 1 : $wp_query->max_num_comment_pages;			} 			$current_per_page = (int) get_query_var( 'comments_per_page' );			if ( (int) $parsed_args['page'] !== $current_cpage || (int) $parsed_args['per_page'] !== $current_per_page ) {				$comment_args = array(					'post_id' => get_the_ID(),					'orderby' => 'comment_date_gmt',					'order'   => 'ASC',					'status'  => 'approve',				); 				if ( is_user_logged_in() ) {					$comment_args['include_unapproved'] = array( get_current_user_id() );				} else {					$unapproved_email = wp_get_unapproved_comment_author_email(); 					if ( $unapproved_email ) {

Changelog

Introduced in 2.7.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, from src/wp-includes/comment-template.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.