Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save badabingbreda/12b5d0ee4b809b3a07afb9158dfa81e4 to your computer and use it in GitHub Desktop.
Save badabingbreda/12b5d0ee4b809b3a07afb9158dfa81e4 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