Skip to content

Commit

Permalink
Fix error template can not render CSS of blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
puleeno committed Jul 1, 2024
1 parent 23730e7 commit da3da1f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ public function getTemplates()
return $this->templates;
}

public function isGutenbergSupport() {
public function isGutenbergSupport()
{
if (is_null($this->isGutenbergSupport)) {
$this->isGutenbergSupport = jankx_is_support_block_template();
}
Expand Down Expand Up @@ -130,7 +131,8 @@ public function render()
{
do_action('jankx/template/render/start', $this);

$engine = Template::getEngine(Jankx::ENGINE_ID);
$template_html = $this->isGutenbergSupport() ? get_the_block_template_html() : null;
$engine = Template::getEngine(Jankx::ENGINE_ID);

if (!$engine->isDirectRender()) {
return $engine->render(
Expand Down Expand Up @@ -172,8 +174,8 @@ public function render()
do_action('jankx/template/page/content/before', $context, $this->templates);


if ($this->isGutenbergSupport()) {
echo get_the_block_template_html();
if (!is_null($template_html)) {
echo $template_html;
} else {
echo $this->renderContent($engine);
}
Expand Down

0 comments on commit da3da1f

Please sign in to comment.