Skip to content

Docs: Align @param tag columns in REST API docblocks - #13312

Open
mukeshpanchal27 wants to merge 1 commit into
WordPress:trunkfrom
mukeshpanchal27:docs/align-param-columns-rest-api
Open

Docs: Align @param tag columns in REST API docblocks#13312
mukeshpanchal27 wants to merge 1 commit into
WordPress:trunkfrom
mukeshpanchal27:docs/align-param-columns-rest-api

Conversation

@mukeshpanchal27

@mukeshpanchal27 mukeshpanchal27 commented Aug 29, 2026

Copy link
Copy Markdown
Member

Trac ticket: https://core.trac.wordpress.org/ticket/65818

The PHP inline documentation standards call for @param tags in a docblock to line up in columns — types, variable names, and descriptions each starting at the same offset — with wrapped descriptions indented to the description column:

/**
 * Summary.
 *
 * @since x.x.x
 *
 * @param string $var       Description.
 * @param bool   $other_var Description that wraps
 *                          onto a second line.
 */

This corrects 17 @param lines across 7 files in the REST API.

Example

src/wp-includes/rest-api/class-wp-rest-server.php — before:

 * @param int $options             JSON encoding options {@see json_encode()}.
 * @param WP_REST_Request $request Current request object.

after:

 * @param int             $options JSON encoding options {@see json_encode()}.
 * @param WP_REST_Request $request Current request object.
Files changed (7)
  • src/wp-includes/rest-api.php
  • src/wp-includes/rest-api/class-wp-rest-server.php
  • src/wp-includes/rest-api/endpoints/class-wp-rest-abilities-v1-categories-controller.php
  • src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php
  • src/wp-includes/rest-api/endpoints/class-wp-rest-menu-items-controller.php
  • src/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php
  • src/wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php

Part of a series

The original work was a single branch touching 80 files. It is split by component so each can be reviewed and committed independently:

This is a whitespace-only change: git diff -w against trunk is empty, so there is no functional change and no change to any generated documentation output beyond the alignment itself.

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5
Used for: Grouping a single large docblock alignment branch into per-component pull requests, verifying that the split is whitespace-only and that the seven branches together reproduce the original diff line for line, and drafting this description. I reviewed the alignment changes before submitting.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018AyprpqvcyKGrDdYmcnQnD
@github-actions

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props mukesh27.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions

Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

注册 for free to join this conversation on GitHub. Already have an account? 登录 to comment

标签

None yet

项目

None yet

Development

Successfully merging this pull request may close these issues.

1 participant