summaryrefslogtreecommitdiff
path: root/classes/pluginhost.php
diff options
context:
space:
mode:
Diffstat (limited to 'classes/pluginhost.php')
-rwxr-xr-xclasses/pluginhost.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/classes/pluginhost.php b/classes/pluginhost.php
index 673053b9e..af3cfcc9b 100755
--- a/classes/pluginhost.php
+++ b/classes/pluginhost.php
@@ -204,6 +204,15 @@ class PluginHost {
function add_hook($type, $sender, $priority = 50) {
$priority = (int) $priority;
+ if (!method_exists($sender, strtolower($type))) {
+ user_error(
+ sprintf("Plugin %s tried to register a hook without implementation: %s",
+ get_class($sender), $type),
+ E_USER_WARNING
+ );
+ return;
+ }
+
if (empty($this->hooks[$type])) {
$this->hooks[$type] = [];
}