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:
@@ -2,6 +2,12 @@
|
|||||||
|
|
||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
## [1.0.7] - 2026-02-18
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- `do_shortcode()` registered as a Twig function in `TwigService`, allowing shortcodes to be rendered directly from Twig templates via `{{ do_shortcode('[shortcode]') }}`
|
||||||
|
|
||||||
## [1.0.6] - 2026-02-14
|
## [1.0.6] - 2026-02-14
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
@@ -132,6 +132,10 @@ class TwigService
|
|||||||
return wp_kses_post($content);
|
return wp_kses_post($content);
|
||||||
}, ['is_safe' => ['html']]));
|
}, ['is_safe' => ['html']]));
|
||||||
|
|
||||||
|
$this->twig->addFunction(new TwigFunction('do_shortcode', function (string $content): string {
|
||||||
|
return do_shortcode($content);
|
||||||
|
}, ['is_safe' => ['html']]));
|
||||||
|
|
||||||
// Formatting.
|
// Formatting.
|
||||||
$this->twig->addFunction(new TwigFunction('number_format_i18n', function (float $number, int $decimals = 0): string {
|
$this->twig->addFunction(new TwigFunction('number_format_i18n', function (float $number, int $decimals = 0): string {
|
||||||
return number_format_i18n($number, $decimals);
|
return number_format_i18n($number, $decimals);
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ Description: A modern WordPress Block Theme built from scratch with Bootstrap 5.
|
|||||||
Requires at least: 6.7
|
Requires at least: 6.7
|
||||||
Tested up to: 6.7
|
Tested up to: 6.7
|
||||||
Requires PHP: 8.3
|
Requires PHP: 8.3
|
||||||
Version: 1.0.6
|
Version: 1.0.7
|
||||||
License: GNU General Public License v2 or later
|
License: GNU General Public License v2 or later
|
||||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||||
Text Domain: wp-bootstrap
|
Text Domain: wp-bootstrap
|
||||||
|
|||||||
Reference in New Issue
Block a user