aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/sites.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/sites.php')
-rw-r--r--engine/lib/sites.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/engine/lib/sites.php b/engine/lib/sites.php
index cf815d885..dbe6d13b1 100644
--- a/engine/lib/sites.php
+++ b/engine/lib/sites.php
@@ -259,8 +259,14 @@
// Insert it
$result = insert_data("INSERT into {$CONFIG->dbprefix}sites_entity (guid, name, description, url) values ($guid, '$name','$description','$url')");
- if ($result!==false)
- return true;
+ if ($result!==false) {
+ get_entity($guid);
+ if (trigger_event('create',$entity->type,$entity)) {
+ return true;
+ } else {
+ delete_entity($guid);
+ }
+ }
}
return false;