I’d like to adjust page content inside the page.create:before
hook. The docs are a bit mysterious about how to use this hook:
return [
'hooks' => [
'page.create:before' => function ($page, $input) {
// your code goes here
}
]
]
$page
is the new page object with all content set.
$input
seems to be the array version of this page object.
My questions are:
- Which of the two parameters am I supposed to change when I’d like to set a content value?
- What am I supposed to
return
? - Am I actually supposed to return anything in the hook?