diff --git a/CHANGELOG.md b/CHANGELOG.md index 6550c2b9c..7b07f366f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ * Updated jQuery from 2.2.0 to 2.2.3 * Set `Uri::ip()` to static by default so it can be used in form fields * Improved `Session` class with flash storage + * `Page::getContentMeta()` now supports an optional key. 1. [](#bugfix) * Fixed "Invalid slug set in YAML frontmatter" when setting `Page::slug()` with empty string [#580](https://github.com/getgrav/grav-plugin-admin/issues/580) * Only `.gitignore` Grav's vendor folder diff --git a/system/src/Grav/Common/Page/Page.php b/system/src/Grav/Common/Page/Page.php index fe5f69602..58f971a36 100644 --- a/system/src/Grav/Common/Page/Page.php +++ b/system/src/Grav/Common/Page/Page.php @@ -639,10 +639,19 @@ class Page /** * Return the whole contentMeta array as it currently stands * + * @param null $name * @return mixed */ - public function getContentMeta() + public function getContentMeta($name = null) { + if ($name) { + if(isset($this->content_meta[$name])) { + return $this->content_meta[$name]; + } else { + return null; + } + + } return $this->content_meta; }