Make WordPress Core


Ignore:
Timestamp:
05/02/2022 10:36:45 AM (3 years ago)
Author:
gziolo
Message:

Editor: Update WordPress packages for 6.0 Beta 4

Included cherry-picked commits from the Gutenberg plugin that fix bugs discovere after WordPress 6.0 Beta 3.

Props zieladam, ndiego, darerodz.
See #55567.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/blocks/comment-author-name.php

    r53157 r53329  
    1919    }
    2020
    21     $comment = get_comment( $block->context['commentId'] );
     21    $comment            = get_comment( $block->context['commentId'] );
     22    $commenter          = wp_get_current_commenter();
     23    $show_pending_links = isset( $commenter['comment_author'] ) && $commenter['comment_author'];
    2224    if ( empty( $comment ) ) {
    2325        return '';
     
    2628    $classes = '';
    2729    if ( isset( $attributes['textAlign'] ) ) {
    28         $classes .= 'has-text-align-' . esc_attr( $attributes['textAlign'] );
    29     }
    30     if ( isset( $attributes['fontSize'] ) ) {
    31         $classes .= 'has-' . esc_attr( $attributes['fontSize'] ) . '-font-size';
     30        $classes .= 'has-text-align-' . $attributes['textAlign'];
    3231    }
    3332
     
    3837    if ( ! empty( $attributes['isLink'] ) && ! empty( $attributes['linkTarget'] ) ) {
    3938        $comment_author = sprintf( '<a rel="external nofollow ugc" href="%1s" target="%2s" >%3s</a>', esc_url( $link ), esc_attr( $attributes['linkTarget'] ), $comment_author );
     39    }
     40    if ( '0' === $comment->comment_approved && ! $show_pending_links ) {
     41        $comment_author = wp_kses( $comment_author, array() );
    4042    }
    4143
Note: See TracChangeset for help on using the changeset viewer.