Documenting all the dynamic hook aliases

A couple of weeks ago at Open SourceOpen Source Open Source denotes software for which the original source code is made freely available and may be redistributed and modified. Open Source **must be** delivered via a licensing model, see GPL. Bridge, I started a conversation with @jorbin about an idea to document common aliases of dynamic hooksHooks In WordPress theme and development, hooks are functions that can be applied to an action or a Filter in WordPress. Actions are functions performed when a certain event occurs in WordPress. Filters allow you to modify certain functions. Arguments used to hook both filters and actions look the same. in coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. 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 WordCampWordCamp WordCamps are casual, locally-organized conferences covering everything related to WordPress. They're one of the places where the WordPress community comes together to teach one another what they’ve learned throughout the year and share the joy. Learn more. Seattle contributor dayContributor Day Contributor Days are standalone days, frequently held before or after WordCamps but they can also happen at any time. They are events where people get together to work on various areas of https://make.wordpress.org/ There are many teams that people can participate in, each with a different focus. https://2017.us.wordcamp.org/contributor-day/ https://make.wordpress.org/support/handbook/getting-started/getting-started-at-a-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 MetaMeta Meta is a term that refers to the inside workings of a group. For us, this is the team that works on internal WordPress sites like WordCamp Central and Make WordPress. TracTrac Trac is the place where contributors create issues for bugs or feature requests much like GitHub.https://core.trac.wordpress.org/..

Yay progress!

#core, #inline-docs