Skip to content

Add --hook=<hook> flag to eval and shell to choose timing #146

@schlessera

Description

@schlessera

Feature Request

For both the eval|eval-file commands as well as the shell command, there's a fixed point in time within the WordPress lifecycle that these are executed.

It would be great to have a --hook=<hook> flag for these that allows the user to postpone when they are being triggered, so that you can choose a specific time within the WordPress lifecycle to run them on.

Describe your use case and the problem you are facing

An example is using these commands to QA new code. Some code can only be executed once the preconditions are met, which means they need to be executed at or after a certain action.

Allowing these commands to be attached to a specific action/filter allows the user to choose when to execute them, so that they can ensure the preconditions for the code to be run are met.

Describe the solution you'd like

This can probably be done by dynamically creating a closure with the code to evaluate or the PsySh breakpoint and attaching that closure to the requested action, instead of immediately executing something.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions