From 5f560cf803158fac4066c669bd4620bc737c64a1 Mon Sep 17 00:00:00 2001 From: Awilum Date: Sat, 30 Nov 2019 23:03:09 +0300 Subject: [PATCH] feat(core): add routable option for entries #284 --- flextype/core/Entries.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/flextype/core/Entries.php b/flextype/core/Entries.php index d6b1e257..a4ff30c5 100755 --- a/flextype/core/Entries.php +++ b/flextype/core/Entries.php @@ -480,6 +480,18 @@ class Entries $data['published_by'] = (Session::exists('uuid') ? Session::get('uuid') : ''); $data['created_by'] = (Session::exists('uuid') ? Session::get('uuid') : ''); + if (isset($data['routable']) && is_array($data['routable'])) { + $data['routable'] = $data['routable']; + } else { + $data['routable'] = true; + } + + if (isset($data['visibility']) && in_array($data['visibility'], ['visible', 'draft', 'hidden'])) { + $data['visibility'] = $data['visibility']; + } else { + $data['visibility'] = 'visible'; + } + return Filesystem::write($entry_file, $this->flextype['parser']->encode($data, 'frontmatter')); }