Inline Documentation

WordPress’ current inline documentation efforts really kicked off starting in the 3.7 releaseRelease A release is the distribution of the final version of an application. A software release may be either public or private and generally constitutes the initial or new generation of a new or upgraded application. A release is preceded by the distribution of alpha and then beta versions of the software. cycle, and gained momentum as the hook docs initiative progressed. The inline documentation, or “inline docs” initiative is a hybrid project, reporting to the CoreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress., Documentation, and Developer Hub teams.

What is inline documentation? What is inline documentation?

Inline documentation provides both necessary and useful information in the form of inline-comments, doc blocks, and more within the source code of WordPress itself.

The inline documentation is parsed with each release, and that documentation is displayed in the Code Reference at developer.wordpress.orgWordPress.org The community site where WordPress code is created and shared by the users. This is where you can download the source code for WordPress core, plugins and themes as well as the central location for community conversations and organization. https://wordpress.org/.

Top ↑

How to get involved How to get involved

Inline documentation is considered to be “technical” documentation, so some familiarity with the WordPress codebase will be necessary – you have to understand the code to write about it.

1. Familiarize yourself with the PHP Documentation Standard, as well as the formatting guidelines and documenting tips.

2. Set up a local copy of the developer version of the WordPress codebase using Varying Vagrant Vagrants (VVV). WordPress is versioning using SVNSVN Apache Subversion (often abbreviated SVN, after its command name svn) is a software versioning and revision control system. Software developers use Subversion to maintain current and historical versions of files such as source code, web pages, and documentation. Its goal is to be a mostly compatible successor to the widely used Concurrent Versions System (CVS). WordPress core and the wordpress.org released code are all centrally managed through SVN. https://subversion.apache.org/., but you can also use GitGit Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. Git is easy to learn and has a tiny footprint with lightning fast performance. Most modern plugin and theme development is being done with this version control system. https://git-scm.com/. (the VVV link for how to do that).

3. Read Opening a Ticket to learn how to create a TracTrac Trac is the place where contributors create issues for bugs or feature requests much like GitHub.https://core.trac.wordpress.org/. ticket.

4. Creating patches:

  • Always update your local copy of WordPress trunk before editing the file and creating patches. Use svn up or git pull, as appropriate.
  • Generate the patch from the root directory of your WordPress SVN or Git checkout. For example, svn diff dir/filename.php > function_name.diff.

5. How to submit a patch

There is one patch to report the inline documentation failures and 
For example, #48303 is such patch for the WordPress 5.4.

  • Add Comment and attach patch file.

6. You can also contribute to inline docs-related Trac tickets that need iteration.

  • If a ticket is marked needs-patch or needs-refresh, it’s possible the existing patch(es) might just need a touch-up or be refreshed against the latest trunk. Every little bit helps!

Top ↑

Points of contact Points of contact

For any questions, pop by the #docs or #core-docs channels in Slack.

Top ↑

Resources Resources

  • PHP Documentation Standard
  • Adam Brown’s Hooks Database (useful for hints on the @since versions of 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.)

Top ↑

How to open new document ticket How to open new document ticket

Basically, there is one ticket to report the inline documentation failures and improvements. But, if you need create new ticket for some reason, follow below steps:

  1. Read Opening a Ticket to learn how to create a Trac ticket.
  2. Create a new ticket on Core Trac for the file:
    • Suggested Title formats could be “PHPDoc correction for path/to/file.php” or “Improve documentation for path/to/file.php”.
    • The Type should be defect (bug).
    • Assign the ticket to the Component the file is associated with.
    • Leave the Version blank.
    • Add the docs Focus by clicking on it.
  3. Upload your patch to the Trac ticket you created, and add the keyword has-patch.
  4. Make sure to leave a comment describing your newly-uploaded patch. Simply uploading patches doesn’t trigger a notification for anyone watching the ticket.

Note: Documentation changes should not mix with code changes (even whitespacing) unless the ticket specifically calls for both.

Last updated: