Skip to content

Commit

Permalink
default to h1
Browse files Browse the repository at this point in the history
  • Loading branch information
ntsekouras committed Mar 12, 2021
1 parent 79eb210 commit 6cc9333
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/block-library/src/query-title/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"level": {
"type": "number",
"default": 2
"default": 1
}
},
"supports": {
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/query-title/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function render_block_core_query_title( $attributes, $content, $block ) {
if ( $is_archive ) {
$title = get_the_archive_title();
}
$tag_name = isset( $attributes['level'] ) ? 'h' . (int) $attributes['level'] : 'h2';
$tag_name = isset( $attributes['level'] ) ? 'h' . (int) $attributes['level'] : 'h1';
$align_class_name = empty( $attributes['textAlign'] ) ? '' : "has-text-align-{$attributes['textAlign']}";
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $align_class_name ) );
return sprintf(
Expand Down
2 changes: 1 addition & 1 deletion packages/e2e-tests/fixtures/blocks/core__query-title.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"name": "core/query-title",
"isValid": true,
"attributes": {
"level": 2
"level": 1
},
"innerBlocks": [],
"originalContent": ""
Expand Down

0 comments on commit 6cc9333

Please sign in to comment.