Opened 5 weeks ago
Last modified 12 hours ago
#65818 new task (blessed)
Coding Standards fixes for 7.2
| Reported by: | desrosj | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.2 |
| Component: | General | Version: | |
| Severity: | normal | Keywords: | has-patch has-unit-tests |
| Cc: | Focuses: |
Change History (65)
This ticket was mentioned in PR #13048 on WordPress/wordpress-develop by @mukesh27.
4 weeks ago
#1
- Keywords has-patch has-unit-tests added
@SergeyBiryukov commented on PR #13048:
4 weeks ago
#3
Thanks for the PR! Merged in r63300.
This ticket was mentioned in PR #13063 on WordPress/wordpress-develop by @mukesh27.
4 weeks ago
#4
Trac ticket: https://core.trac.wordpress.org/ticket/65818
The PHP inline documentation standards place @return immediately after the last @param tag, with no blank line between them:
/** * Summary. * * @since x.x.x * * @param string $var Description. * @return string Description. */
This corrects 44 docblocks across 33 files in src/wp-includes that used a line break between the two tags.
Documentation-only; no functional change.
## Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5
Used for: I found a few occurrences myself, and Claude helped me identify the remaining ones and draft the PR.
@mukesh27 commented on PR #13063:
4 weeks ago
#6
This ticket was mentioned in PR #13119 on WordPress/wordpress-develop by @mukesh27.
4 weeks ago
#7
Trac ticket: https://core.trac.wordpress.org/ticket/65818
Follow-up to #13063 in which it covers core file changes.
The PHP inline documentation standards place @return immediately after the last @param tag, with no blank line between them:
/** * Summary. * * @param string $var Description. * @return string Description. */
This corrects 65 docblocks across 29 files in the PHPUnit test suite.
Documentation-only; no functional change in tests.
## Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5
Used for: I found a few occurrences myself, and Claude helped me identify the remaining ones and draft the PR.
@SergeyBiryukov commented on PR #13119:
3 weeks ago
#9
Thanks for the PR! Merged in r63333.
This ticket was mentioned in PR #13263 on WordPress/wordpress-develop by @Soean.
3 weeks ago
#10
join() is an alias of implode(). Using the canonical function name is strongly recommended, as aliases may be deprecated or removed without (much) warning. This replaces the last three uses of the alias in actively maintained PHP code.
The three instances were introduced in 49200, 60704 and 61326, after the previous alias cleanups in 49193, 56616 and 57567.
## Scope
This brings the number of join() calls in actively maintained PHP code to zero. The following occurrences are deliberately left untouched:
src/wp-includes/atomlib.php— bundled third-party library (AtomLib by Elias Torres)src/wp-includes/rss.php— bundled third-party library (MagpieRSS), deprecated since 3.0.0src/wp-includes/class-json.php— bundled third-party library (Services_JSON), deprecated since 5.3.0src/wp-admin/includes/deprecated.php— deprecated functions, kept as-is for historical accuracysrc/wp-includes/media-template.php— this isArray.prototype.join()in a JavaScript template, not PHP
Trac ticket: https://core.trac.wordpress.org/ticket/65818
@mukesh27 commented on PR #13263:
2 weeks ago
#11
Nice!
Previously it was committed similar changes https://core.trac.wordpress.org/changeset/49193, https://core.trac.wordpress.org/changeset/56616 and https://core.trac.wordpress.org/changeset/57567
@SergeyBiryukov commented on PR #13263:
2 weeks ago
#13
Thanks for the PR! Merged in r63347.
This ticket was mentioned in PR #13304 on WordPress/wordpress-develop by @Soean.
2 weeks ago
#15
The four object getters on WP_Customize_Manager: get_setting(), get_panel(), get_section() and get_control(), each spell out an isset() guard followed by return null. The null coalescing operator says the same thing in one line.
?? applies the same isset() semantics as the guard it replaces, and since the fallback here is null itself, both forms return the identical value in every case. This covers the complete set of same-shaped getters in the class.
Follow-up to [63378]
Trac ticket: https://core.trac.wordpress.org/ticket/65818
This ticket was mentioned in PR #13311 on WordPress/wordpress-develop by @mukesh27.
2 weeks ago
#17
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 58 @param lines across 16 files in the block editor, block supports, and theme.json classes.
### Example
src/wp-admin/widgets-form-blocks.php — before:
* @param string $message The message being displayed. * @param bool $installed Whether the Classic Widget plugin is installed.
after:
* @param string $message The message being displayed. * @param bool $installed Whether the Classic Widget plugin is installed.
<details>
<summary>Files changed (16)</summary>
src/wp-includes/blocks.phpsrc/wp-includes/blocks/accordion.phpsrc/wp-includes/blocks/heading.phpsrc/wp-includes/blocks/list.phpsrc/wp-includes/blocks/navigation-link.phpsrc/wp-includes/blocks/navigation.phpsrc/wp-includes/blocks/page-list.phpsrc/wp-includes/blocks/social-link.phpsrc/wp-includes/blocks/widget-group.phpsrc/wp-includes/block-supports/layout.phpsrc/wp-includes/block-supports/settings.phpsrc/wp-includes/block-template-utils.phpsrc/wp-includes/class-wp-theme-json.phpsrc/wp-includes/class-wp-theme-json-schema.phpsrc/wp-includes/style-engine/class-wp-style-engine-css-rules-store.phpsrc/wp-admin/widgets-form-blocks.php
</details>
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.
This ticket was mentioned in PR #13312 on WordPress/wordpress-develop by @mukesh27.
2 weeks ago
#18
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.
<details>
<summary>Files changed (7)</summary>
src/wp-includes/rest-api.phpsrc/wp-includes/rest-api/class-wp-rest-server.phpsrc/wp-includes/rest-api/endpoints/class-wp-rest-abilities-v1-categories-controller.phpsrc/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.phpsrc/wp-includes/rest-api/endpoints/class-wp-rest-menu-items-controller.phpsrc/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.phpsrc/wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.php
</details>
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.
This ticket was mentioned in PR #13313 on WordPress/wordpress-develop by @mukesh27.
2 weeks ago
#19
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 23 @param lines across 10 files in the upgrade/install, plugins, and themes code.
### Example
src/wp-admin/includes/class-wp-automatic-updater.php — before:
* @param bool $checkout Whether a VCS checkout was discovered at `$context` * or ABSPATH, or anywhere higher. * @param string $context The filesystem context (a path) against which * filesystem status should be checked.
after:
* @param bool $checkout Whether a VCS checkout was discovered at `$context` * or ABSPATH, or anywhere higher. * @param string $context The filesystem context (a path) against which * filesystem status should be checked.
<details>
<summary>Files changed (10)</summary>
src/wp-admin/includes/upgrade.phpsrc/wp-admin/includes/class-wp-automatic-updater.phpsrc/wp-admin/includes/class-wp-site-health-auto-updates.phpsrc/wp-admin/includes/plugin.phpsrc/wp-admin/includes/plugin-install.phpsrc/wp-admin/includes/theme.phpsrc/wp-includes/theme.phpsrc/wp-includes/class-wp-theme.phpsrc/wp-content/themes/twentytwelve/functions.phpsrc/wp-content/themes/twentyfourteen/functions.php
</details>
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.
This ticket was mentioned in PR #13314 on WordPress/wordpress-develop by @mukesh27.
2 weeks ago
#20
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 19 @param lines across 7 files in the users and multisite code.
### Example
src/wp-admin/user-edit.php — before:
* @param bool $enable Whether to display the capabilities. Default true. * @param WP_User $profile_user The current WP_User object.
after:
* @param bool $enable Whether to display the capabilities. Default true. * @param WP_User $profile_user The current WP_User object.
<details>
<summary>Files changed (7)</summary>
src/wp-includes/user.phpsrc/wp-includes/ms-functions.phpsrc/wp-includes/class-wp-session-tokens.phpsrc/wp-includes/sitemaps/providers/class-wp-sitemaps-users.phpsrc/wp-admin/includes/user.phpsrc/wp-admin/user-edit.phpsrc/wp-admin/user-new.php
</details>
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.
This ticket was mentioned in PR #13315 on WordPress/wordpress-develop by @mukesh27.
2 weeks ago
#21
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 23 @param lines across 11 files in the posts, comments, taxonomy, and media APIs.
### Example
src/wp-admin/comment.php — before:
* @param string $location The URI the user will be redirected to. * @param int $comment_id The ID of the comment being edited.
after:
* @param string $location The URI the user will be redirected to. * @param int $comment_id The ID of the comment being edited.
<details>
<summary>Files changed (11)</summary>
src/wp-includes/comment.phpsrc/wp-includes/comment-template.phpsrc/wp-admin/comment.phpsrc/wp-includes/post.phpsrc/wp-includes/post-template.phpsrc/wp-includes/taxonomy.phpsrc/wp-includes/meta.phpsrc/wp-includes/media.phpsrc/wp-admin/includes/media.phpsrc/wp-includes/class-wp-image-editor.phpsrc/wp-admin/includes/post.php
</details>
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.
This ticket was mentioned in PR #13316 on WordPress/wordpress-develop by @mukesh27.
2 weeks ago
#22
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 19 @param lines across 13 files in the administration screens.
### Example
src/wp-admin/includes/class-wp-community-events.php — before:
* @param int $user_id WP user ID. * @param false|array $user_location {
after:
* @param int $user_id WP user ID. * @param false|array $user_location {
<details>
<summary>Files changed (13)</summary>
src/wp-admin/includes/class-wp-list-table.phpsrc/wp-admin/includes/class-wp-posts-list-table.phpsrc/wp-admin/includes/class-wp-terms-list-table.phpsrc/wp-admin/includes/list-table.phpsrc/wp-admin/includes/template.phpsrc/wp-admin/includes/class-wp-internal-pointers.phpsrc/wp-admin/includes/class-wp-community-events.phpsrc/wp-includes/class-wp-admin-bar.phpsrc/wp-includes/class-walker-nav-menu.phpsrc/wp-includes/class-walker-page.phpsrc/wp-includes/class-wp-customize-manager.phpsrc/wp-includes/customize/class-wp-customize-selective-refresh.phpsrc/wp-includes/widgets.php
</details>
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.
This ticket was mentioned in PR #13317 on WordPress/wordpress-develop by @mukesh27.
2 weeks ago
#23
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 38 @param lines across 16 files in the general core APIs.
### Example
src/wp-includes/class-wp-fatal-error-handler.php — before:
* @param array $args Associative array of arguments passed to `wp_die()`. By default these contain a * 'response' key, and optionally 'link_url' and 'link_text' keys. * @param array $error Error information retrieved from `error_get_last()`.
after:
* @param array $args Associative array of arguments passed to `wp_die()`. By default these contain a * 'response' key, and optionally 'link_url' and 'link_text' keys. * @param array $error Error information retrieved from `error_get_last()`.
<details>
<summary>Files changed (16)</summary>
src/wp-includes/functions.phpsrc/wp-includes/load.phpsrc/wp-includes/class-wp-fatal-error-handler.phpsrc/wp-includes/class-wp-hook.phpsrc/wp-includes/cron.phpsrc/wp-includes/formatting.phpsrc/wp-includes/general-template.phpsrc/wp-includes/link-template.phpsrc/wp-includes/option.phpsrc/wp-includes/embed.phpsrc/wp-includes/class-wp-oembed.phpsrc/wp-includes/class-wp-http-requests-hooks.phpsrc/wp-includes/pomo/mo.phpsrc/wp-includes/pomo/translations.phpsrc/wp-includes/functions.wp-scripts.phpsrc/wp-admin/includes/file.php
</details>
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.
@mukesh27 commented on PR #13311:
2 weeks ago
#24
GB changes PR https://github.com/WordPress/gutenberg/pull/81903
#25
@
13 days ago
Regarding 7.2, I was wondering if we could reconsider the introduction of the WordPress-Docs ruleset. This might allow us to automatically fix some of the manual work.
- The WordPress-Docs ruleset was previously attempted but discontinued. However, with the help of AI, we should be able to fix all errors. See #50744.
- Gutenberg previously had the WordPress-Docs ruleset, but it was removed to align with the core. If we can introduce this ruleset into the core, we might be able to revive it in Gutenberg as well. See https://github.com/WordPress/gutenberg/pull/56982.
@wildworks commented on PR #13311:
13 days ago
#26
This needs to be fixed, similar to GutenbergPR.
@mukesh27 commented on PR #13311:
12 days ago
#27
The files in
src/wp-includes/blocks/should not be updated.
Reverted.
@SergeyBiryukov commented on PR #13304:
11 days ago
#29
Thanks for the PR! Merged in r63411.
@wildworks commented on PR #13317:
7 days ago
#35
@wildworks commented on PR #13316:
7 days ago
#37
@wildworks commented on PR #13312:
7 days ago
#39
@wildworks commented on PR #13313:
7 days ago
#41
@wildworks commented on PR #13311:
7 days ago
#43
@wildworks commented on PR #13314:
7 days ago
#45
@wildworks commented on PR #13315:
7 days ago
#47
This ticket was mentioned in PR #13409 on WordPress/wordpress-develop by @mukesh27.
7 days ago
#48
Trac ticket: https://core.trac.wordpress.org/ticket/65818
GB https://github.com/WordPress/gutenberg/pull/82488
## Use of AI Tools
This ticket was mentioned in PR #13414 on WordPress/wordpress-develop by @mukesh27.
5 days ago
#49
Trac ticket: https://core.trac.wordpress.org/ticket/65818
GB https://github.com/WordPress/gutenberg/pull/81904
## Use of AI Tools
N/A
This ticket was mentioned in PR #13415 on WordPress/wordpress-develop by @mukesh27.
5 days ago
#50
Trac ticket: https://core.trac.wordpress.org/ticket/65818
GB https://github.com/WordPress/gutenberg/pull/81903
## Use of AI Tools
N/A
This ticket was mentioned in PR #13416 on WordPress/wordpress-develop by @mukesh27.
5 days ago
#51
Trac ticket: https://core.trac.wordpress.org/ticket/65818
GB https://github.com/WordPress/gutenberg/pull/81902
## Use of AI Tools
N/A
@wildworks commented on PR #13414:
4 days ago
#53
@wildworks commented on PR #13415:
4 days ago
#55
@wildworks commented on PR #13416:
4 days ago
#57
This ticket was mentioned in PR #13482 on WordPress/wordpress-develop by @mukesh27.
19 hours ago
#58
Trac ticket: https://core.trac.wordpress.org/ticket/65818
GB https://github.com/WordPress/gutenberg/pull/82690
## Use of AI Tools
N/A
This ticket was mentioned in PR #13483 on WordPress/wordpress-develop by @mukesh27.
18 hours ago
#59
Trac ticket: https://core.trac.wordpress.org/ticket/65818
Corrects "continuing form earlier output" to "continuing from earlier output" in the $last_offset parameter description.
Documentation only, no functional change.
## Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5
Used for: Drafting the PR, drafting this description. I have reviewed the change and take responsibility for it.
This ticket was mentioned in PR #13484 on WordPress/wordpress-develop by @mukesh27.
18 hours ago
#60
Trac ticket: https://core.trac.wordpress.org/ticket/65818
## Use of AI Tools
N/A
This ticket was mentioned in PR #13487 on WordPress/wordpress-develop by @mukesh27.
17 hours ago
#61
Trac ticket: https://core.trac.wordpress.org/ticket/65818
Replaces the $array[ array_key_last( $array ) ] in WP_Block_Parser::add_inner_block() with a direct call to array_last().
## Use of AI Tools
N/A
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Trac ticket: https://core.trac.wordpress.org/ticket/65818
Changed unconventional comma operator to semicolon for better readability and conventional PHP style.
While the comma operator is technically valid PHP syntax, using a semicolon is the conventional and more readable approach.
## Use of AI Tools
Use for drafting PR details