From 5345a115d7ea123008bd36f4198d63730634e204 Mon Sep 17 00:00:00 2001 From: AK Delfin Date: Sun, 21 Apr 2024 23:21:21 +0300 Subject: [PATCH] add view to functions --- functions.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/functions.php b/functions.php index bceeb72..81d49a7 100644 --- a/functions.php +++ b/functions.php @@ -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()); + + } +} +