radiate-framework / framework

A WordPress plugin and theme framework
https://radiate-framework.github.io/
MIT License
4 stars 0 forks source link

Event listener priority #169

Open BenRutlandWeb opened 2 years ago

BenRutlandWeb commented 2 years ago

Is your feature request related to a problem? Please describe. I can't specify the event listener priority in the event service provider.

Describe the solution you'd like A static property on the listener to set the priority.

Describe alternatives you've considered Registering the listeners in a subscriber or with the facade directly.

Additional context Laravel used to allow this, it was removed as it's not good practice - listeners should be order-agnostic, however, WordPress uses priorities for core events so the ability to set the priority is still relevant in certain circumstances. The static property should possibly not be exposed by default in listener stubs.