Skip to content

Commit

Permalink
Workaround for do_blocks css render issue as per comment WordPress/gu…
Browse files Browse the repository at this point in the history
  • Loading branch information
abinalexpothen authored Feb 22, 2023
1 parent 07eb235 commit 6c87b0a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions classes/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -8712,6 +8712,10 @@ public function convert_date_into_wp_timezone( string $date ): string {
public function tutor_custom_header() {
global $wp_version;
if ( version_compare( $wp_version, '5.9', '>=' ) && function_exists( 'wp_is_block_theme' ) && wp_is_block_theme() ) {
$theme = wp_get_theme();
$theme_slug = $theme->get( 'TextDomain' );
$header_theme_block = do_blocks( '<!-- wp:template-part {"slug":"header","theme":"' . $theme_slug . '","tagName":"header","className":"site-header","layout":{"inherit":true}} /-->' );

?>
<!doctype html>
<html <?php language_attributes(); ?>>
Expand All @@ -8723,9 +8727,7 @@ public function tutor_custom_header() {
<?php wp_body_open(); ?>
<div class="wp-site-blocks">
<?php
$theme = wp_get_theme();
$theme_slug = $theme->get( 'TextDomain' );
echo do_blocks( '<!-- wp:template-part {"slug":"header","theme":"' . $theme_slug . '","tagName":"header","className":"site-header","layout":{"inherit":true}} /-->' );
echo $header_theme_block;
} else {
get_header();
}
Expand Down

0 comments on commit 6c87b0a

Please sign in to comment.