Skip to content

Commit

Permalink
Block theme: Ensure all pages have a top-level heading
Browse files Browse the repository at this point in the history
Fixes #665
  • Loading branch information
ryelle committed Apr 15, 2024
1 parent 38fc588 commit 33a81cc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,10 @@ function update_archive_title( $block_content, $block, $instance ) {
}
}

if ( is_search() ) {
$title = __( 'Search results', 'wporg-patterns' );
}

$tag_name = isset( $attributes['level'] ) ? 'h' . (int) $attributes['level'] : 'h1';
$align_class_name = empty( $attributes['textAlign'] ) ? '' : "has-text-align-{$attributes['textAlign']}";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
<div style="margin-top:0;margin-bottom:0;height:var(--wp--preset--spacing--50)" aria-hidden="true" class="wp-block-spacer"></div>
<!-- /wp:spacer -->

<!-- wp:query-title {"type":"filter","level":1,"className":"screen-reader-text"} /-->

<!-- wp:post-template {"style":{"spacing":{"blockGap":"var:preset|spacing|40"}},"layout":{"type":"grid","columnCount":3}} -->
<!-- wp:group {"style":{"spacing":{"blockGap":"5px"}}} -->
<div class="wp-block-group">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<!-- wp:wporg/status-notice {"align":"wide"} /-->
<?php endif; ?>

<!-- wp:post-title {"align":"wide","fontSize":"heading-3"} /-->
<!-- wp:post-title {"level":1,"align":"wide","fontSize":"heading-3"} /-->

<!-- wp:group {"layout":{"type":"flex","flexWrap":"nowrap"},"align":"wide"} -->
<div class="wp-block-group alignwide">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<!-- /wp:wporg/notice -->
<?php endif; ?>

<!-- wp:post-title {"align":"wide","fontSize":"heading-3"} /-->
<!-- wp:post-title {"level":1,"align":"wide","fontSize":"heading-3"} /-->

<!-- wp:group {"layout":{"type":"flex","flexWrap":"wrap"},"align":"wide"} -->
<div class="wp-block-group alignwide">
Expand Down

0 comments on commit 33a81cc

Please sign in to comment.