How do I append to the end of the comments array in WordPress?
- by thinkswan
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.