Skip to content

Commit ea5e59b

Browse files
committed
Add hook option
1 parent a41ea65 commit ea5e59b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

index.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44

55
Kirby::plugin('sylvainjule/categories', array(
66
'options' => [
7-
'watch' => []
7+
'watch' => [],
8+
'hook' => true,
89
],
910
'hooks' => [
1011
'page.update:after' => function($newPage, $oldPage) {
11-
if(!option('languages')) return;
12+
if(!option('languages') || !option('sylvainjule.categories.hook')) return;
1213

1314
$categories = new Categories();
1415
$changes = $categories->getChangesArray($this, $newPage, $oldPage);
@@ -20,7 +21,7 @@
2021
return $newPage;
2122
},
2223
'site.update:after' => function($newSite, $oldSite) {
23-
if(!option('languages')) return;
24+
if(!option('languages') || !option('sylvainjule.categories.hook')) return;
2425

2526
$categories = new Categories();
2627
$changes = $categories->getChangesArray($this, $newSite, $oldSite);

0 commit comments

Comments
 (0)