diff -r 7b1b88e27a20 -r 48c4eec2b7e6 wp/wp-includes/blocks/site-tagline.php --- a/wp/wp-includes/blocks/site-tagline.php Thu Sep 29 08:06:27 2022 +0200 +++ b/wp/wp-includes/blocks/site-tagline.php Fri Sep 05 18:40:08 2025 +0200 @@ -8,6 +8,8 @@ /** * Renders the `core/site-tagline` block on the server. * + * @since 5.8.0 + * * @param array $attributes The block attributes. * * @return string The render. @@ -17,11 +19,18 @@ if ( ! $site_tagline ) { return; } + + $tag_name = 'p'; $align_class_name = empty( $attributes['textAlign'] ) ? '' : "has-text-align-{$attributes['textAlign']}"; $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $align_class_name ) ); + if ( isset( $attributes['level'] ) && 0 !== $attributes['level'] ) { + $tag_name = 'h' . (int) $attributes['level']; + } + return sprintf( - '
%2$s
', + '<%1$s %2$s>%3$s%1$s>', + $tag_name, $wrapper_attributes, $site_tagline ); @@ -29,6 +38,8 @@ /** * Registers the `core/site-tagline` block on the server. + * + * @since 5.8.0 */ function register_block_core_site_tagline() { register_block_type_from_metadata( @@ -38,4 +49,5 @@ ) ); } + add_action( 'init', 'register_block_core_site_tagline' );