Title: comments_array filter issue
Last modified: May 1, 2020

---

# comments_array filter issue

 *  Resolved [Larry Lewis](https://wordpress.org/support/users/jenolan/)
 * (@jenolan)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/comments_array-filter-issue/)
 * I am trying to parse comments using the filter ‘comments_array’ when I enable
   the filter with;
 * `add_filter( 'comments_array', 'jshout_comments' );`
 * All I am doing initially is;
 *     ```
       function jshout_comments( $comments, $id )
       {
       	return( $comments );
       }
       ```
   
 * What happens is that all themes (incl twenty_*) immediately break, I have debug
   on and nothing is reported it is almost as though a ‘die()’ is happening. If 
   I comment out add filter all works, uncomment the theme breaks .. stops all output.
 * Any ideas to help track it down would be appreciated.
 * Larry

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/comments_array-filter-issue/#post-12765351)
 * You need to specify how many args are passed if it’s more than one.
    `add_filter('
   comments_array', 'jshout_comments', 10, 2 );`
 * I think everyone has made this mistake at least once 🙂
 *  Thread Starter [Larry Lewis](https://wordpress.org/support/users/jenolan/)
 * (@jenolan)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/comments_array-filter-issue/#post-12766658)
 * ug .. yes that fixed it bugger!
 * Thanks!!!
    Larry

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘comments_array filter issue’ is closed to new replies.

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 2 replies
 * 2 participants
 * Last reply from: [Larry Lewis](https://wordpress.org/support/users/jenolan/)
 * Last activity: [6 years, 1 month ago](https://wordpress.org/support/topic/comments_array-filter-issue/#post-12766658)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
