Skip to content

Plugin can hook on events 'before' and 'after' other plugins #1169

@mattab

Description

@mattab

See use case of plugin #1168

Hooks should be executed in a certain order, so that some plugins modify the data and other can access the recorded data. In some cases, it is not possible to add new hooks as a given data point (eg. the user IP) can be modified by several hooks.

The hook registration should maybe be a function call rather than the current array format. This function would have a priority parameter that would define, from 1 to 100, the priority at which the function should be called. For example, plugins that modify the data and needs to access its raw state, they would set priority=1. Plugins that record the data would set 100. Hooks that modify the value after basic filters would set priority=50.

The range could maybe be from 1 to 10. I am not sure of any code standard regarding this pattern? Also, this is similar to filter priority in wordpress hooks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    MajorIndicates the severity or impact or benefit of an issue is much higher than normal but not critical.TaskIndicates an issue is neither a feature nor a bug and it's purely a "technical" change.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions