<?php

/*
Plugin Name: Test comment_text args param
Plugin URI: http://simonwheatley.co.uk/wordpress/tctap
Description: A quick plugin to test that the proposed comment_text filter <var>$args</var> parameter actually works.
Version: 0.1
Author: Simon Wheatley
Author URI: http://simonwheatley.co.uk/wordpress/
*/
 
/*  Copyright 2010 Simon Wheatley

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

*/

/**
 * Hooks the WP comment_text filter and adds on a print_r of the 
 * $args formatting options passed in to test the proposed new
 * $args parameter.
 *
 * @param string $comment_text The HTML content of the comment 
 * @param array $args The array of formatting options, if it exists
 * @return string The HTML comment content
 **/
function tctap_comment_text( $comment_text, $comment_ID, $args ) {
	$args_printout = print_r( $args, true );
	$comment_text = "<hr /><pre>Comment ID: $comment_ID\n$args_printout</pre><hr />$comment_text";
	return $comment_text;
}
add_filter( 'comment_text', 'tctap_comment_text', null, 3 );

?>