• Resolved Larry Lewis

    (@jenolan)


    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

    (@bcworkz)

    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

    (@jenolan)

    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.