Editing Articles

Codex to Code Reference

As an example, let’s compare two pages of add_action to understand which sections are transferred to which areas:

Codex (archives):

Code Reference:

Top ↑

Description, Syntax, Parameters and Returns

The Description, Syntax, Parameters and Returns should be converted to inline docs in the function headerHeader The header of your site is typically the first thing people will experience. The masthead or header art located across the top of your page is part of the look and feel of your website. It can influence a visitor’s opinion about your content and you/ your organization’s brand. It may also look different on different screen sizes.. These inline docs are automatically converted and added to the Code Reference.

For our example, refer to this source code. https://core.trac.wordpress.org/browser/tags/5.2/src/wp-includes/plugin.php#L384. As you can see, the function header includes description and @since, @param and @return tags. Those tags form the Description, Syntax, and Parameters for this function and have been automatically added to the Code Reference.

All functions already have inline docs but not with the same level of information as the Codex. A lot of information was dropped during initial function header creation.

To add/update inline docs, refer to this page:
https://make.wordpress.org/docs/handbook/code-reference/inline-documentation/. You will need some development skills to build the environment and contribute.

Notes: Inline docs may not have enough syntax or space to describe every detail parameters or returned values. In these cases, use Explanation field.

Top ↑

Usage, Notes and Programming Topics

These should be migrated to the Explanation field of the Code Reference and are displayed in the “More Information” section.

Note: One line Usage such as the following do not need to be migrated due to its triviality.

<?php get_post_comments_feed_link( $post_id, $feed ) ?>

To add/edit the Explanation field, your 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/ account need to have an editor role or above added for the Developer Reference. To be added, go to the #docs channel on slack and ask one of the rep on The Team to add you.

Top ↑

Usage Examples

Usage examples are migrated as the User Comments for each page.

Refer to this document for more details: https://make.wordpress.org/docs/handbook/code-reference/editing-articles/migrating-from-codex/

Top ↑

Getting Started

We’re tracking the migrationMigration Moving the code, database and media files for a website site from one server to another. Most typically done when changing hosting companies. of the Codex to the Code Reference in this spreadsheet: 

Top ↑

First reserve the page where you want to edit.

  1. In the tracking spreadsheet, search for ‘Partially done’ rows using the Status column (Column H).
  2. Enter your name in the Editor column (Column F) and change the Status column (Column H) to ‘In Progress’. If you don’t have write permission to the spreadsheet, please DM your Google account to @atachibana on #docs channel.

Top ↑

Compare Codex and Code Reference

  1. Open Codex page and Code Reference page and compare them
  2. If Code Reference has full information of Codex, then OK
  3. If Code Reference does not have some information, refer above Codex to Code Reference and migrate missing information on the Codex page to the Code Reference appropriately.
    • When you create a Ticket to modify the inline documentation, change the status to ‘Waiting’, and leave the ticket number in Notes (Column I).
    • If you cannot migrate every section, leave a comment in the Notes column (Column I) noting what’s left and change the Status to ‘Partially done’.

Top ↑

Redirect the page from Codex to Code Reference.

After the migration complete, redirect codex page to Code Reference.

Top ↑

When the Codex page has a language locator

  1. From the Codex page, click Edit on right side menu.
  2. Put following message below the language locator, and comment out the current Codex contents using <!-- and -->.
{{en|WordPress Features}}
{{ja|WordPress Features}}
This page was moved to https://developer.wordpress.org/reference/functions/(function name)/ except above language locator.
  1. Click Show Preview at the bottom of the page and confirm your changes.
  2. Enter the text “Transferred to DevHub” in the Summary box and click Save page.

Top ↑

When the Codex page does not have a language locator

  1. From the Codex page, click Edit on right side menu.
  2. Put following tag at the top of the page, and adjust the URLURL A specific web address of a website or web page on the Internet, such as a website’s URL www.wordpress.org.
{{#dotorgredirect: https://developer.wordpress.org/reference/functions/(function name)/}}
  1. Enter the text “Transferred to DevHub” in the Summary box and click Save page.

NOTE: Once you save the page, viewing the page will redirect you to the DevHub version of the page. If you want to modify the saved page, add &action=edit to the URL.
e.g. https://codex.wordpress.org/index.php?title=Function_Reference/add_action&action=edit

Top ↑

Release this page

Change the “In Progress” status to “Done” (Column H).

Top ↑

Progress Stats


Last updated: