diff options
-rwxr-xr-x | classes/pluginhost.php | 9 |
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] = []; } |