Jetpack Launches New Developer Code Reference

The Jetpack team launched developer.jetpack.com this week, a searchable code reference for actions, filters, and features found in the plugin. Although Jetpack is developed to be highly extensible, up until now there was no centralized place for developers to find documentation. The reference features new hooks added in the most recent version and can also be toggled to other versions.

jetpack-developer

As the search feature does not yet have autocomplete, developers will need to enter the exact hook they want to query, because anything not found in the reference will return no results. Searching general terms or Jetpack features will turn up a list of hooks to hunt through. The reference could benefit from pagination or infinite scroll on results, but its basic features are much better than the alternative of having to search through the codebase yourself. Results list a hook’s available parameters and many include usage examples.

According to Jetpack team member Jeremy Herve, the site was modeled after the WordPress code reference.

“It uses the same parser to generate documentation from the plugin’s codebase, and its goals are similar: provide some information to folks who want to know more about a specific hook, or want to know how to customize specific aspects of Jetpack,” Herve said.

Herve and other team members have written many posts with code snippets and most recently the Hook of the Month series, but beefing up the inline documentation took up the bulk of the time in launching the new reference.

“When building that code reference, the hardest part was probably to go back and review all the codebase, to add inline documentation,” Herve said. “That’s what took us the most time.”

The Jetpack team plans to improve the search function and is considering adding autocomplete. They are also working to add more unique content and code samples for the hooks, as not all of them are fully documented yet. This content will demonstrate best practices for extending Jetpack.

“Right now, I think one of the first things we’re interested in is getting feedback from developers: do they find this useful, what’s missing, what can we improve?” Herve asked. Reviewing an example filter like jetpack_open_graph_tags gives you an idea of the type of content the team is hoping to provide for more hooks. Feedback is welcome on the announcement or via the Jetpack support form.

Would you like to write for WP Tavern? We are always accepting guest posts from the community and are looking for new contributors. Get in touch with us and let's discuss your ideas.

5 Comments


  1. Great to see the Jetpack team setting a positive example for other plugins in terms of improving the quality and completeness of their inline documentation. Internal and extension developers all win!

    Report


  2. This looks really nice. Anyone know where the developer.wordpress.org parser can be viewed? Love the idea of auto-generating developer docs using inline comments.

    Report


    1. I also recommend child theming the wporg-developer theme in use on DevHub. It has a ton of built-in functionality for retrieving and formatting information injected by the parser.

      Report


  3. This is great news – Jetpack was already useful, but now it will be easier to tweak as well. I’m sure alot of work went into it.

    Report

Comments are closed.