Make WordPress Core

Ticket #16576: 16576.diff

File 16576.diff, 2.3 KB (added by valendesigns, 10 years ago)
  • src/wp-includes/comment-template.php

    diff --git src/wp-includes/comment-template.php src/wp-includes/comment-template.php
    index 40db646..07350f6 100644
    function comment_form( $args = array(), $post_id = null ) { 
    22822282                                                        ?>
    22832283                                                <?php else : ?>
    22842284                                                        <?php echo $args['comment_notes_before']; ?>
    2285                                                         <?php
     2285                                                <?php endif; ?>
     2286                                                <?php
     2287                                                /**
     2288                                                 * Fires before the comment fields in the comment form.
     2289                                                 *
     2290                                                 * @since 3.0.0
     2291                                                 */
     2292                                                do_action( 'comment_form_before_fields' );
     2293                                                foreach ( (array) $args['fields'] as $name => $field ) {
    22862294                                                        /**
    2287                                                          * Fires before the comment fields in the comment form.
    2288                                                          *
    2289                                                          * @since 3.0.0
     2295                                                         * Do not display the default fields for logged in users.
    22902296                                                         */
    2291                                                         do_action( 'comment_form_before_fields' );
    2292                                                         foreach ( (array) $args['fields'] as $name => $field ) {
    2293                                                                 /**
    2294                                                                  * Filter a comment form field for display.
    2295                                                                  *
    2296                                                                  * The dynamic portion of the filter hook, $name, refers to the name
    2297                                                                  * of the comment form field. Such as 'author', 'email', or 'url'.
    2298                                                                  *
    2299                                                                  * @since 3.0.0
    2300                                                                  *
    2301                                                                  * @param string $field The HTML-formatted output of the comment form field.
    2302                                                                  */
    2303                                                                 echo apply_filters( "comment_form_field_{$name}", $field ) . "\n";
    2304                                                         }
     2297                                                        if ( is_user_logged_in() && in_array( $name, array( 'author', 'email', 'url' ) ) )
     2298                                                                continue;
    23052299                                                        /**
    2306                                                          * Fires after the comment fields in the comment form.
     2300                                                         * Filter a comment form field for display.
     2301                                                         *
     2302                                                         * The dynamic portion of the filter hook, $name, refers to the name
     2303                                                         * of the comment form field. Such as 'author', 'email', or 'url'.
    23072304                                                         *
    23082305                                                         * @since 3.0.0
     2306                                                         *
     2307                                                         * @param string $field The HTML-formatted output of the comment form field.
    23092308                                                         */
    2310                                                         do_action( 'comment_form_after_fields' );
    2311                                                         ?>
    2312                                                 <?php endif; ?>
     2309                                                        echo apply_filters( "comment_form_field_{$name}", $field ) . "\n";
     2310                                                }
     2311                                                /**
     2312                                                 * Fires after the comment fields in the comment form.
     2313                                                 *
     2314                                                 * @since 3.0.0
     2315                                                 */
     2316                                                do_action( 'comment_form_after_fields' );
     2317                                                ?>
    23132318                                                <?php
    23142319                                                /**
    23152320                                                 * Filter the content of the comment textarea field for display.