Skip to content

Commit

Permalink
Updated the sample condition
Browse files Browse the repository at this point in the history
Make people aware that this also hits pages in the trash / which are moved to the trash.
  • Loading branch information
LostKobrakai committed Feb 19, 2015
1 parent 333ffb3 commit 700961f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions extending-page-save-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ title: Extending page save process

----

version: 1.0.0
version: 1.0.1

----

Expand Down Expand Up @@ -65,7 +65,7 @@ class HookAfterPagesSave extends WireData implements Module {
$page = $event->arguments[0];

// Sample condition and changes
if($page->template == "basic-page"){
if($page->template == "basic-page" && !$page->isTrash()){
$page->addStatus(Page::statusLocked);
// Page will be saved right after this hook, so no need to call save().
// Every other page you load and edit here needs to be saved manually.
Expand Down

0 comments on commit 700961f

Please sign in to comment.