Forked from jstask82/timber twig callback for mb blocks.php
Created
October 11, 2022 19:58
-
-
Save badabingbreda/12b5d0ee4b809b3a07afb9158dfa81e4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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