add view to functions

This commit is contained in:
2024-04-21 23:21:21 +03:00
parent aac3261047
commit 5345a115d7

View File

@@ -753,4 +753,27 @@ $hash_link.\n\n
add_action('wpcf7_mail_sent', 'my_custom_mail_sent' );
/**
*
*/
if (!function_exists('view')){
function view ($view, $data = array(), $layer = null){
ob_start();
if (is_array($data))
extract($data);
if ($layer !== null){
$content = view($view, $data);
require $layer;
}
else
require $view;
return trim(ob_get_clean());
}
}