[wp-hackers] edit comment form

Will Norris will at willnorris.com
Fri Apr 27 17:44:36 GMT 2007

I maintain a port of Alan Castonguay's openid plugin at <http:// 
wordpress.org/extend/plugins/openid/> and was recently made aware of  
a problem when using the plugin with PHP 5.2.  Part of what the  
plugin does is to modify the comment form to include an additional  
input field for a user's OpenID.  To do this, it uses output  
buffering to capture the form, then some regex magic to make the  
necessary changes.  The problem is that it appears the callback  
method specified in ob_start() no longer has access to global  
variables in recent versions of PHP; this is not considered a bug  
<http://bugs.php.net/bug.php?id=40104>.  So I'm now looking for  
suggestions for how one might modify the comment form.

One possibility would be to attempt a new filter, but I'm not  
completely sure that would work.  Even if it did, this whole thing  
feels kinda weird... it feels much cleaner to have the user modify  
their theme directly, as most plugins require.  I guess another  
option would be to push it to the client side and modify the DOM with  
some javascript... still not ideal, but a little cleaner.  Does  
anyone have other ideas on modifying the comment form?  Alan, I'd  
love to hear your thoughts, since you can definitely shed some light  
on alternatives you might have considered when you first wrote this.


More information about the wp-hackers mailing list