You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, I would be 100% happy if these hooks would just be included in the actions.json without any args/docs, as I use actions.json primarily to ensure that used hooks exist (and only secondary to validate the hook types)
It's easy enough with nikic PHP parser directly in enterNode function for e.g. wp_schedule_single_event: (for wp_schedule_event index is 2 instead of 1)
Is there maybe some way I can custom add this (like a custom visitor or something I can declare when calling the hooks generator)?
bc I realized there are some custom cases, that will call a hook callback too, I'd like to add (besides the obvious WP cron stuff and the WC action scheduler)
I'm really not sure - the parsing is handled by wp-parser-lib which is just the parsing code from the WP Parser plugin extracted into a reusable library. I've not looked into it in depth.
Activity
johnbillion commentedon May 6, 2022
Thanks for the report. How should these be documented? It's a dynamic hook added by other plugins.
kkmuffme commentedon May 6, 2022
Just normally with phpdoc for the $args I'd say
However, I would be 100% happy if these hooks would just be included in the actions.json without any args/docs, as I use actions.json primarily to ensure that used hooks exist (and only secondary to validate the hook types)
johnbillion commentedon May 6, 2022
Ah I see what you mean. While that would be useful it would require a whole different parser to detect and extract these. PRs welcome!
kkmuffme commentedon May 7, 2022
It's easy enough with nikic PHP parser directly in enterNode function for e.g. wp_schedule_single_event: (for wp_schedule_event index is 2 instead of 1)
And the way to get the phpdoc is the same as now for actions/filters.
kkmuffme commentedon May 19, 2022
Is there maybe some way I can custom add this (like a custom visitor or something I can declare when calling the hooks generator)?
bc I realized there are some custom cases, that will call a hook callback too, I'd like to add (besides the obvious WP cron stuff and the WC action scheduler)
johnbillion commentedon May 19, 2022
I'm really not sure - the parsing is handled by wp-parser-lib which is just the parsing code from the WP Parser plugin extracted into a reusable library. I've not looked into it in depth.
Namespaces, deprecated and scheduled hooks, performance,...
Namespaces, deprecated and scheduled hooks, performance,...