Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround for gutenberg do_blocks() render issue affecting tutor courses and dashboard pages #358

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions classes/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -8735,6 +8735,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 @@ -8746,9 +8750,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