added variables in create_html with compact

This commit is contained in:
asus
2024-02-08 15:24:22 +01:00
parent 070364c992
commit 2f62f06f04
9 changed files with 37 additions and 14 deletions

View File

@@ -6,11 +6,13 @@
#
# https://stackoverflow.com/a/4402045/9497573
function create_html($files) {
# takes two arguments :
# a list of the html files to include in front
# a list of variables to make available to this files
function create_html($files, $vars) {
$html_dir = plugin_dir_path(__DIR__).'html/';
$template_dir = plugin_dir_path(__DIR__).'html/templates/';
$names = ["hugo", "camille"];
extract($vars);
ob_start();
foreach($files as $file) {