$name)); } /** * Returns snippet content for shortcode {snippet get="snippetname"} * * @param array $attributes snippet filename */ public static function _content($attributes) { if (isset($attributes['get'])) $name = (string)$attributes['get']; else $name = ''; $snippet_path = STORAGE . DS . 'snippets' . DS . $name . '.snippet.php'; if (File::exists($snippet_path)) { // Turn on output buffering ob_start(); // Include view file include $snippet_path; // Output... return ob_get_clean(); } else { if (Session::exists('admin') && Session::get('admin') == true) { return __('Snippet :name is not found!', 'snippets', array(':name' => $name)); } } } }