Skip to content

Instantly share code, notes, and snippets.

@jstask82
Created October 11, 2022 16:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jstask82/ec69915874aa4e72a4c42b3402a14a72 to your computer and use it in GitHub Desktop.
Save jstask82/ec69915874aa4e72a4c42b3402a14a72 to your computer and use it in GitHub Desktop.
function mb_block_renderer($attributes, $is_preview = false, $post_id = null)
{
$context = Timber::context();
$context['content'] = $attributes['data'];
$context['is_preview'] = $is_preview;
$context['post_id'] = $post_id;
Timber::render("blocks/{$attributes['name']}.twig", $context);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment