PluginProbe ʕ •ᴥ•ʔ
Zenchef widget integration / 1.3.0
Zenchef widget integration v1.3.0
1.3.0 1.0.1 1.2.0 trunk 1.0.0
zenchef-widget-integration / src / View / render.php
zenchef-widget-integration / src / View Last commit date
render.php 2 weeks ago
render.php
23 lines
1 <?php
2
3 namespace Zenchef\Widget\View;
4
5 use function extract;
6 use const Zenchef\Widget\ROOT_PATH;
7
8 /**
9 * Templates carry a .php extension rather than .phtml because `wp i18n make-pot`
10 * only parses *.php. Under .phtml the translatable strings inside them never
11 * reached translate.wordpress.org, so no locale could translate them.
12 *
13 * @param string $path
14 * @param array<string, mixed> $variables
15 * @return string
16 */
17 function render($path, array $variables = [])
18 {
19 extract($variables);
20
21 return include ROOT_PATH . 'views/' . $path . '.php';
22 }
23