You've already forked wp-bootstrap
feat: register do_shortcode() as Twig function (v1.0.7)
Adds do_shortcode to TwigService::registerWordPressFunctions() so child
themes and partials can render WordPress shortcodes directly inside Twig
templates via {{ do_shortcode('[shortcode]') }}.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -132,6 +132,10 @@ class TwigService
|
||||
return wp_kses_post($content);
|
||||
}, ['is_safe' => ['html']]));
|
||||
|
||||
$this->twig->addFunction(new TwigFunction('do_shortcode', function (string $content): string {
|
||||
return do_shortcode($content);
|
||||
}, ['is_safe' => ['html']]));
|
||||
|
||||
// Formatting.
|
||||
$this->twig->addFunction(new TwigFunction('number_format_i18n', function (float $number, int $decimals = 0): string {
|
||||
return number_format_i18n($number, $decimals);
|
||||
|
||||
Reference in New Issue
Block a user