$context */ public static function render(string $template, array $context): string { $template = sanitize_file_name($template); $themePath = locate_template('procalendarwp/' . $template . '.php'); $premiumPath = PCWP_PATH . 'premium/templates/' . $template . '.php'; $packagePath = is_readable($premiumPath) ? $premiumPath : PCWP_PATH . 'templates/' . $template . '.php'; $path = $themePath !== '' ? $themePath : $packagePath; if (! is_readable($path)) { return ''; } extract($context, EXTR_SKIP); ob_start(); include $path; return (string) ob_get_clean(); } }