diff --git a/packages/block-library/src/post-title/block.json b/packages/block-library/src/post-title/block.json index d17ad5cc0e93a..2fd03ef784a84 100644 --- a/packages/block-library/src/post-title/block.json +++ b/packages/block-library/src/post-title/block.json @@ -50,6 +50,7 @@ "__experimentalFontFamily": true, "__experimentalFontWeight": true, "__experimentalFontStyle": true, + "__experimentalTextDecoration": true, "__experimentalTextTransform": true, "__experimentalLetterSpacing": true, "__experimentalDefaultControls": { diff --git a/packages/block-library/src/post-title/index.php b/packages/block-library/src/post-title/index.php index 78f1e859fbffa..a881f9e1f10f9 100644 --- a/packages/block-library/src/post-title/index.php +++ b/packages/block-library/src/post-title/index.php @@ -33,10 +33,19 @@ function render_block_core_post_title( $attributes, $content, $block ) { $tag_name = 0 === $attributes['level'] ? 'p' : 'h' . $attributes['level']; } + $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $align_class_name ) ); + if ( isset( $attributes['isLink'] ) && $attributes['isLink'] ) { - $title = sprintf( '%4$s', get_the_permalink( $post_ID ), esc_attr( $attributes['linkTarget'] ), esc_attr( $attributes['rel'] ), $title ); + return sprintf( + '<%1$s>%6$s', + $tag_name, + get_the_permalink( $post_ID ), + esc_attr( $attributes['linkTarget'] ), + esc_attr( $attributes['rel'] ), + $wrapper_attributes, + $title + ); } - $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $align_class_name ) ); return sprintf( '<%1$s %2$s>%3$s',