Filter hook 'wp_list_comments_args'

in WP Core File wp-includes/comment-template.php at line 2274

View Source

wp_list_comments_args

Filter Hook
Description
Filters the arguments used in retrieving the comment list.

Hook Information

File Location wp-includes/comment-template.php View on GitHub
Hook Type Filter
Line Number 2274

Hook Parameters

Type Name Description
array $parsed_args An array of arguments for displaying comments.

Usage Examples

Basic Usage
<?php
// Hook into wp_list_comments_args
add_filter('wp_list_comments_args', 'my_custom_filter', 10, 1);

function my_custom_filter($parsed_args) {
    // Your custom filtering logic here
    return $parsed_args;
}

Source Code Context

wp-includes/comment-template.php:2274 - How this hook is used in WordPress core
<?php
2269  	 *
2270  	 * @see wp_list_comments()
2271  	 *
2272  	 * @param array $parsed_args An array of arguments for displaying comments.
2273  	 */
2274  	$parsed_args = apply_filters( 'wp_list_comments_args', $parsed_args );
2275  
2276  	// Figure out what comments we'll be looping through ($_comments).
2277  	if ( null !== $comments ) {
2278  		$comments = (array) $comments;
2279  		if ( empty( $comments ) ) {

PHP Documentation

<?php
/**
	 * 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.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/comment-template.php
Related Hooks

Related hooks will be displayed here in future updates.