Skip to content

Commit

Permalink
New onPageContent() event
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Mar 20, 2019
1 parent b4a4b60 commit 9d8fc4a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# v1.5.9
## mm/dd/2019

1. [](#new)
* Added new `onPageContent()` event for every call to `Page::content()`
1. [](#improved)
* Fixed phpdoc generation

Expand Down
2 changes: 2 additions & 0 deletions system/src/Grav/Common/Page/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,8 @@ public function content($var = null)
$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;
Expand Down

0 comments on commit 9d8fc4a

Please sign in to comment.