Skip to content

Calling a custom plugin method inside module #9823

Answered by brandonkelly
joepagan asked this question in Q&A
Discussion options

You must be logged in to vote

A helpful suggestion linked to this discussion which suggests maybe plugins aren't available at the point that modules load?
OP's solution here it to wrap this plugin method in an event EVENT_AFTER_LOAD_PLUGINS, though this is not really maintainable if you want to use it at multiple places throughout your module.

Yep that’s the way to go, as plugins are loaded after modules. You will only need to worry about this trick for code in your module’s init() method (or called from it).

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@joepagan
Comment options

Answer selected by brandonkelly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants