Jump to content

finding the Hook order?


benbyf
 Share

Recommended Posts

  • benbyf changed the title to finding the Hook order?

@benbyf In your PW admin, when in debug mode, there is a "Debug" link at the bottom right of the screen. If you click that it opens a panel and one of the options in the panel is "Hooks". Click Hooks to open and it'll show you all the hooks that are in use and in what order.

The "priority" column indicates order... The smaller the priority number, the earlier it executes, so a priority of 99 executes before 100. But in the Hooks list on the debug screen you'll see priority numbers like 100.0, 100.1, 100.2, etc. This indicates that the hooks were added with the same priority (100, which is the default) and the number after the decimal indicates the order they were added in. They execute in the same order, so 100.0 executes before 100.1, 100.1 executes before 100.2, etc. 

If you are looking for a way to get this info for some other purpose you can find the code that generates this debug info in /wire/templates-admin/debug.inc, but basically it amounts to a displaying the return values from wire()->getHooks('*'); 

  • Like 5
Link to comment
Share on other sites

42 minutes ago, benbyf said:

got a slow process and a lot of hooks, trying to nail down in what order they get triggered and which one is causing the issue

If you're not a ProDevTools user yet it might be a bit overkill, but just wanted to mention that ProfilerPro is brilliant for this type of use case ?

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...