--- a/wp/wp-includes/blocks/comment-reply-link.php Thu Sep 29 08:06:27 2022 +0200
+++ b/wp/wp-includes/blocks/comment-reply-link.php Fri Sep 05 18:40:08 2025 +0200
@@ -8,6 +8,8 @@
/**
* Renders the `core/comment-reply-link` block on the server.
*
+ * @since 6.0.0
+ *
* @param array $attributes Block attributes.
* @param string $content Block default content.
* @param WP_Block $block Block instance.
@@ -34,7 +36,7 @@
// Compute comment's depth iterating over its ancestors.
while ( ! empty( $parent_id ) ) {
- $depth++;
+ ++$depth;
$parent_id = get_comment( $parent_id )->comment_parent;
}
@@ -51,12 +53,15 @@
return;
}
- $classes = '';
+ $classes = array();
if ( isset( $attributes['textAlign'] ) ) {
- $classes .= 'has-text-align-' . $attributes['textAlign'];
+ $classes[] = 'has-text-align-' . $attributes['textAlign'];
+ }
+ if ( isset( $attributes['style']['elements']['link']['color']['text'] ) ) {
+ $classes[] = 'has-link-color';
}
- $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) );
+ $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => implode( ' ', $classes ) ) );
return sprintf(
'<div %1$s>%2$s</div>',
@@ -67,6 +72,8 @@
/**
* Registers the `core/comment-reply-link` block on the server.
+ *
+ * @since 6.0.0
*/
function register_block_core_comment_reply_link() {
register_block_type_from_metadata(