Skip to content

Commit

Permalink
Add use_custom_page_title flag to choose which page title to use
Browse files Browse the repository at this point in the history
  • Loading branch information
trymebytes committed Nov 21, 2024
1 parent 52d298f commit efc017e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ function ( $breadcrumbs ) use( $event ): array {
return '';
}
$attributes['event'] = $event;
$attributes['use_custom_page_title'] = true;

render_page(
__DIR__ . '/render.php',
'',
esc_html( $event->title() ),
$attributes
);
},
Expand Down
2 changes: 1 addition & 1 deletion themes/wporg-translate-events-2024/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ function render_page( string $template_path, string $title, array $attributes ):
require $template_path;
$rendered_template = ob_get_clean();
$page_title = esc_html( $title );
$page_title_block = ! empty( $page_title ) ? do_blocks( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
$page_title_block = ( empty( $attributes['use_custom_page_title'] ) ) ? do_blocks( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
<<<BLOCKS
<!-- wp:group {"layout":{"type":"flex","flexWrap":"nowrap","justifyContent":"space-between"}} -->
<div class="wp-block-group page-upcoming-title-past-wrapper">
Expand Down

0 comments on commit efc017e

Please sign in to comment.