mirror of
https://github.com/getgrav/grav.git
synced 2026-07-20 08:11:13 +02:00
Added ability to get a specific item of content meta
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user