New onPageContent() event

This commit is contained in:
Andy Miller
2019-03-20 11:14:38 -06:00
parent 28d5be982c
commit b23cd7bb65
2 changed files with 3 additions and 0 deletions

View File

@@ -2,6 +2,7 @@
## mm/dd/2019
1. [](#new)
* Added new `onPageContent()` event for every call to `Page::content()`
* Added phpstan: PHP Static Analysis Tool [#2393](https://github.com/getgrav/grav/pull/2393)
* Added `composer test-plugins` to test plugin issues with the current version of Grav
* Grav 1.6: Renamed `$grav['users']` service to `$grav['accounts']`

View File

@@ -749,6 +749,8 @@ class Page implements PageInterface
$this->content = str_replace("<p>{$delimiter}</p>", '', $this->content);
}
// Fire event when Page::content() is called
Grav::instance()->fireEvent('onPageContent', new Event(['page' => $this]));
}
return $this->content;