A couple of weeks ago at Open Source Bridge, I started a conversation with @jorbin about an idea to document common aliases of dynamic hooks in core docs. A long-standing pain point in core, and now in the Code Reference, is that dynamic hooks aren’t really searchable.
For example, let’s say I want to search for the ‘publish_post’ hook. If I search the source, I see add_action() calls referencing that hook, but its origin is nowhere to be found. This is because the hook is actually {$new_status}_{$post->post_type}.
The idea would be to make it possible to search the source and the Code Reference for indexed common aliases like ‘publish_post’ and have it return the reference for {$new_status}_{$post->post_type}.
Great, so what’s next?
We’ve already started a spreadsheet at the WordCamp Seattle contributor day to begin identifying common aliases of all of the dynamic hooks in core. Big thanks goes to @trepmal for providing a complete list of all dynamic hooks from her presentation slides.
If you’d like to get in on the ground floor and help out, the spreadsheet can be found here: https://docs.google.com/spreadsheets/d/1QfHEPhI9j_Dts5XAxC_kX-LvdE0fxyHlnRFomOTFzQk/edit#gid=0
Over the next few weeks, I’ll be working with @rarst to devise a solution for parsing hook aliases using WP-Parser. When we have a solution in place, we start planning the effort to begin patching hook docs in core.
We’ll be tracking progress on #557-meta on Meta Trac.
Yay progress!