The time to document ALL THE HOOKS used throughout core is nigh.
We’ve hashed out the process in a couple of different meetings in #wordpress-dev, and we’ve added a new leaf to the Core Contributor Handbook that covers the broader PHPDoc standards, as well as the specific hook documentation standards (the praise for the bulk of that work should go to Kim Parsell and Drew Jaynes, by the way).
our process for getting patches in hasn’t yet been proven, but we’re going to give it a shot here. If it proves to be unwieldy, we’ll try a different direction, and I’ll update this post. Until then, here’s how we’re going to go about everything:
At the bottom is a list of every file in core that has a call to either do_action() or apply_filters(). Files with a checkmark have been patched and are considered completed. Directly below is the process we’re attempting to make sure each of these files can get patched swiftly — with no duplicated nor wasted efforts.
How to contribute:
- Leave a comment on this post with the file(s)* you’re about to edit (check the comments first to make sure it’s not already being edited)
- Edit fervently and make a patch quickly
- Submit your patch to the Add Inline Docs for Hooks trac ticket
- Update your comment here to say patch submitted
- Rinse and repeat!
*Note: We strongly encourage you to work on very few files at a time. In many cases, one at a time is probably best. In some cases it may make sense to tackle several at once. The important thing is that you realize your edits should be made and patched swiftly so that they aren’t invalidated by (or don’t invalidate) another patch. It’s also important to note that we’re working with a small time-table, and need to be able to claim, edit, patch quickly — which is hard to do if someone were to lay claim to 20 files at a time, and then sit on them for a few days.
Determining the @since version for hooks
You can use svn blame and walk back through the history of a file to determine when any given hook was introduced. This can be fairly time-consuming, as you’ll have to compare which patch introduced the change with the date it was added via Trac, then use the date to determine which major release directly followed. We don’t want this to be a barrier for getting docs in, so please feel free to use “@since Unknown” to submit your patch, and someone more interested in tracing svn blame can add the version number later.
Keeping Discussions Focused:
Any discussion about the specifics of a patch itself should happen on Trac, like it always does. Any discussion about the broader scope of what we’re trying to do should take place here on the make/core P2.
Files needing patches: (checked files are completed)
186 files total
Ryan McCue 1:37 am on September 14, 2013 Permalink | Log in to Reply
For anyone who’s wondering what the hell is going on on Windows: You have to run grunt via the Windows command line, and you cannot run it via Cygwin. If you do run it via Cygwin, you’ll see random inexplicable errors and missing output. It’s pretty annoying (in fact, it stops me from using Grunt), but you can’t really do anything about it.
Aaron Jorbin 4:31 am on September 14, 2013 Permalink | Log in to Reply
Sorry to here about the problems on Windows. According to Grunt’s FAQ, the problem is that Cygwin bundles an outdated version of node.js. Have you tried the suggestion to install node and npm separately and then use either Windows command prompt or PowerShell ?
Ryan McCue 10:48 am on September 14, 2013 Permalink | Log in to Reply
It’s actually a platform-limitation of Cygwin. You can work around it with
cygstart grunt ..., but it opens in a new window and doesn’t work with the current shell: http://code.google.com/p/mintty/issues/detail?id=56adamsilverstein 6:17 pm on September 14, 2013 Permalink | Log in to Reply
Great post, thanks for keeping this moving!
K.Adam White 5:50 pm on September 16, 2013 Permalink | Log in to Reply
For those on Windows, the “msys” shell that installs as “Git Bash” when you download the official Windows build of Git should work fine once you install the Windows build of Node.