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 ) { |
2282 | 2282 | ?> |
2283 | 2283 | <?php else : ?> |
2284 | 2284 | <?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 ) { |
2286 | 2294 | /** |
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. |
2290 | 2296 | */ |
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; |
2305 | 2299 | /** |
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'. |
2307 | 2304 | * |
2308 | 2305 | * @since 3.0.0 |
| 2306 | * |
| 2307 | * @param string $field The HTML-formatted output of the comment form field. |
2309 | 2308 | */ |
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 | ?> |
2313 | 2318 | <?php |
2314 | 2319 | /** |
2315 | 2320 | * Filter the content of the comment textarea field for display. |