[wp-hackers] How to remove URL field in Comments Form

Baki Goxhaj banago at gmail.com
Fri Aug 27 00:25:54 UTC 2010


Beau,

Yes, I was looking for the filter and that is fantastic information. Thanks!

Kindly,

Baki Goxhaj
www.wplancer.com | www.banago.info | www.lintuts.com


On 26 August 2010 03:07, Beau Lebens <beau at dentedreality.com.au> wrote:

> If you're using the new default theme, Twenty Ten, then you could
> write a filter that would remove it before comment_form() is called.
> It would look something like this (in your functions.php, or a plugin,
> or whatever):
>
> add_filter( 'comment_form_default_fields', 'remove_comment_url_field' );
> function remove_comment_url_field( $fields ) {
>        unset( $fields['url'] );
>        return $fields;
> }
>
> If you're using a theme that doesn't use comment_form() (new in 3.0,
> so very likely), then you'd need to just hack the comments.php file
> within your theme normally. Since the URL field is not required, you
> shouldn't need to do any special handling (un-handling) to get around
> that.
>
> I just did a short presentation on the comment_form() function at
> WordCamp Savannah:
> http://www.slideshare.net/beaulebens/hooking-into-comments-5047868
>
> Beau
>
>
> On Wed, Aug 25, 2010 at 5:33 AM, Baki Goxhaj <banago at gmail.com> wrote:
> > I want to get rid of the url field in my comments form - how can I
> achieve
> > that? Thanks!
> >
> > Kindly,
> >
> > Baki Goxhaj
> > www.wplancer.com | www.banago.info | www.lintuts.com
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> >
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list