Add server side hooks listeners in runtime?
Solved
Plugin Development
-
I'm trying to figure this out. Is there a way to add a listener for a server side hook in runtime without adding it to
plugin.json
?Something like
Plugins.registerHook('filter:groups.get', myRuntimeFunc)
.The plugin I'm creating would benefit from this so the user have more control over when data should be fetched from an external API. I believe the answer will be no, but I need to ask.
-
@magnusvhendin said in Add server side hooks listeners in runtime?:
Plugins.registerHook('filter:groups.get', myRuntimeFunc)
This should work. The call is different though use
plugins.registerHook('somePlugin', { hook: 'filter:config.get', method: onConfigGet });
Copyright © 2024 NodeBB | Contributors