How do I append to the end of the comments array in WordPress?

Posted by thinkswan on Stack Overflow See other posts from Stack Overflow or by thinkswan
Published on 2010-05-22T03:09:27Z Indexed on 2010/05/22 3:10 UTC
Read the original article Hit count: 364

Filed under:
|
|
|

I'm trying to include something at the end of the comments array for a WordPress plugin.

I currently have add_filter('comments_array', 'my_function'), where my_function($comments='') is something along the lines of:

my_function($comments='') {
  echo 'something';

  return $comments;
}

I obviously can't return the comments first, and echoing them doesn't work because $comments is a multi-dimensional array. Is there some way I can print the WordPress comments and then append something to them?

Thanks.

© Stack Overflow or respective owner

Related posts about Wordpress

Related posts about plugins