register_hook('AJAX_CALL_UNKNOWN', 'BEFORE', $this, 'callback'); } public function callback(Doku_Event $event, $param) { global $INPUT; if ($event->data !== 'plugin_' . $this->getPluginName()) { return; } //no other ajax call handlers needed $event->stopPropagation(); $event->preventDefault(); header('Content-Type: application/json'); echo (new JsonRequest(new Embedded(), $INPUT->param('csrf'), $INPUT->param('payload')))->handle(); } }