wp_list_comments( string|array $args = array(), WP_Comment[] $comments = null ): void|string
- Since
- 2.7.0
- Source
wp-includes/comment-template.php:2237
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: nullInstance of a Walker class to list comments.$max_depthintdefault: emptyThe maximum comments depth.$stylestringdefault: 'ul'The style of list ordering. Accepts 'ul', 'ol', or 'div'. 'div' will result in no additional list markup.$callbackcallabledefault: nullCallback 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: emptyPage ID to list comments for.$per_pageintdefault: emptyNumber of comments to list per page.$avatar_sizeintdefault: 32Height and width dimensions of the avatar size.$reverse_top_levelbooldefault: nullOrdering of the listed comments. If true, will display newest comments first.$reverse_childrenbooldefault: nullWhether to reverse child comments in the list.$formatstringdefault: 'html5' if the theme supports itHow to format the comments list. Accepts 'html5', 'xhtml'.$short_pingbooldefault: falseWhether to output short pings.$echobooldefault: trueWhether 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
- Scaling
- Constant
- Instructions
- 89–202
- Plugin surface
- 1 hook
- Called by
- 0
Reaches the database via get_comments().
No loop in the body: the same number of instructions runs whatever you pass in.
Executed per call on PHP 8.5, depending on the branch taken. The body compiles to 314.
Third-party callbacks on 'wp_list_comments_args' run inside this call, and their cost is not bounded by anything here.
Nothing in core calls this; the cost is only what you spend yourself.
What it touches
- hookthird-party callbacks
apply_filters()called directly - optionoption read or write
get_option()called directly - querycontent query
get_comments()called directly - cacheobject cache
wp_cache_get()one call below wp_list_comments() - serializeserialisation
maybe_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.
| When | Instructions | Calls it makes |
|---|---|---|
!current_theme_supports() && $comments === null && $parsed_args && $current_cpage !== false && !is_user_logged_in() && empty($comments_by_type) | 89 | current_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–145 | current_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–151 | current_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–153 | current_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–150 | current_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–159 | current_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–157 | current_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–156 | current_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–159 | current_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–161 | current_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–165 | current_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–158 | current_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–159 | current_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–164 | current_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–160 | current_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–162 | current_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–164 | current_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–163 | current_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–162 | current_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–164 | current_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–164 | current_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–166 | current_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–170 | current_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–165 | current_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–165 | current_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–170 | current_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–166 | current_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–170 | current_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–167 | current_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–167 | current_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–168 | current_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–172 | current_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–169 | current_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–169 | current_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–171 | current_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–170 | current_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–170 | current_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–170 | current_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–176 | current_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–174 | current_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–171 | current_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–172 | current_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–178 | current_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–175 | current_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–173 | current_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–173 | current_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–174 | current_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–178 | current_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–175 | current_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–175 | current_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–175 | current_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–175 | current_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–176 | current_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–176 | current_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–177 | current_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–180 | current_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–177 | current_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–178 | current_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–178 | current_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–178 | current_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–184 | current_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–180 | current_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–181 | current_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–179 | current_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–179 | current_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–180 | current_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–183 | current_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–181 | current_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–182 | current_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–183 | current_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–183 | current_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–183 | current_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–183 | current_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–184 | current_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–184 | current_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–184 | current_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–184 | current_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–185 | current_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–185 | current_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–186 | current_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–186 | current_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–189 | current_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–187 | current_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–188 | current_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–188 | current_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–189 | current_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–189 | current_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–190 | current_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–190 | current_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–191 | current_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–192 | current_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–192 | current_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–193 | current_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–194 | current_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–194 | current_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–196 | current_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–197 | current_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–198 | current_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–202 | current_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
| PHP | Compiled | Executed | Branches | Notes |
|---|---|---|---|---|
| 8.6-dev | 313 | 89–201 | 35 | 1 fewer instruction than PHP 8.5 |
| 8.5 | 314 | 89–202 | 35 | |
| 8.4 | 314 | 89–202 | 35 | |
| 8.3 | 314 | 89–202 | 35 | |
| 8.2 | 314 | 89–202 | 35 | |
| 8.1 | 314 | 89–202 | 35 | 1 fewer instruction than PHP 7.4 |
| 7.4 | 315 | 89–202 | 35 |
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:
- apply_filters( wp_list_comments_args )filterline 2274 (+37 into the body)
Filters the arguments used in retrieving the comment list.
Uses · 14
- current_theme_supports()Checks a theme's support for a given feature.
- wp_parse_args()Merges user defined arguments into defaults array.
- apply_filters()Calls the callback functions that have been added to a filter hook.
- separate_comments()Separates an array of comments into an array keyed by comment_type.
- get_query_var()Retrieves the value of a query variable in the WP_Query class.
- get_option()Retrieves an option value based on an option name.
- get_the_ID()Retrieves the ID of the current item in the WordPress Loop.
- is_user_logged_in()Determines whether the current visitor is a logged in user.
- get_current_user_id()Gets the current user's ID.
- wp_get_unapproved_comment_author_email()Gets unapproved comment author's email.
- get_comments()Retrieves a list of comments.
- get_comment_pages_count()Calculates the total number of comment pages.
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.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 6.8.8 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.