benbyf Posted September 13, 2022 Share Posted September 13, 2022 Is there a way of finding how many things are using a Hook and in what order they are getting executed?? Link to comment Share on other sites More sharing options...
ryan Posted September 14, 2022 Share Posted September 14, 2022 @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('*'); 5 Link to comment Share on other sites More sharing options...
benbyf Posted September 14, 2022 Author Share Posted September 14, 2022 Thanks Ryan! got a slow process and a lot of hooks, so trying to nail down in what order they get triggered and which one is causing the issue Link to comment Share on other sites More sharing options...
teppo Posted September 14, 2022 Share Posted September 14, 2022 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 ? 2 Link to comment Share on other sites More sharing options...
benbyf Posted September 14, 2022 Author Share Posted September 14, 2022 26 minutes ago, teppo said: 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 ? sounds like worth a look ? 1 Link to comment Share on other sites More sharing options...
szabesz Posted September 14, 2022 Share Posted September 14, 2022 On 9/13/2022 at 11:10 AM, benbyf said: Is there a way of finding how many things are using a Hook and in what order they are getting executed?? Also related: 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now