[wp-trac] [WordPress Trac] #21877: Disabling author field in comments makes "awaiting moderation" go away

WordPress Trac wp-trac at lists.automattic.com
Wed Sep 19 17:25:11 UTC 2012


#21877: Disabling author field in comments makes "awaiting moderation" go away
-------------------------------+------------------------------
 Reporter:  hakankpunkt        |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Comments           |     Version:  3.4.1
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |
-------------------------------+------------------------------

Comment (by hakankpunkt):

 I added this filter in the themes functions.php to disable some
 fields including the author field. Please note, that only disabling
 the author field is causing the bug.


 {{{
 /**
  * Disable comment fields
  *
  * @param array The fields array
  * @return array The fields array with the disabled comment fields
  */
 function disable_comment_fields($fields)
 {
         unset($fields['author']);
         unset($fields['email']);
         unset($fields['url']);

         return $fields;
 }

 add_filter('comment_form_default_fields', 'disable_comment_fields',
 10030);
 }}}

 As a workaround I used following filter in the themes function.php


 {{{
 /**
  * Set a default author name for comments
  *
  * This is a workaround for this bug
 http://core.trac.wordpress.org/ticket/21877
  */
 function set_default_author_name($data)
 {
     return 'John Doe Default';
 }

 add_filter('pre_comment_author_name', 'set_default_author_name', 10050);
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/21877#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list