[wp-trac] [WordPress Trac] #16576: comment_form() fields being displayed only for non logged in users

WordPress Trac wp-trac at lists.automattic.com
Wed Feb 16 18:15:44 UTC 2011


#16576: comment_form() fields being displayed only for non logged in users
-------------------------+-----------------------------
 Reporter:  maorb        |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Comments     |    Version:  3.0.5
 Severity:  normal       |   Keywords:
-------------------------+-----------------------------
 I've just noticed this - When using the '''comment_form()''' function and
 adding some comment meta fields,using the fields array in the $args, these
 fields are being showed in the front-end only for non logged in users.
 In this case, the registered users can never use these comment fields.

 Look at wp-includes/comment-template, lines 1561-1573 (WP 3.0.5), it parse
 the $args['fields'] in the else block -

 {{{
 <?php if ( is_user_logged_in() ) : ?>
         <?php echo apply_filters( 'comment_form_logged_in',
 $args['logged_in_as'], $commenter, $user_identity ); ?>
         <?php do_action( 'comment_form_logged_in_after', $commenter,
 $user_identity ); ?>
 <?php else : ?>
         <?php echo $args['comment_notes_before']; ?>
         <?php
         do_action( 'comment_form_before_fields' );
         foreach ( (array) $args['fields'] as $name => $field ) {
                 echo apply_filters( "comment_form_field_{$name}", $field )
 . "\n";
         }
         do_action( 'comment_form_after_fields' );
         ?>
 <?php endif; ?>
 }}}

 I think it is better that added meta fields should be displayable for all
 users (logged in and not logged in), or even to add a parameter to let the
 developer decide which extra fields are shown to logged or not logged
 users.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/16576>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list