'type'=> 'comment',
    <ol class="comments-list">
     <?php wp_list_comments($args) ?>


function my_comment_list($comment,$arg,$depth){


When trying to create a callback function called my_comment_list, it looks like I need three types of arguments for the callback function, $ comment, $ arg, $ depth,

My question is:

How do you know you need these arguments for callback function? and Where do you get detailed explanations of arguments, etc.?

I usually refer to the below link in Wordpress template tags and functions, but It was not there...

Wordpress Developer Resource

1 Answer 1


wp_list_comments() uses Walker_Comment class to render the output.

See Walker_Comment->start_el() method for callback argument:


And Walker_Comment->end_el() method for end-callback argument:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.