Skip to content

docs: fix missing filter @param names in WP_Theme_JSON_Resolver_Gutenberg` - #68386

Merged
westonruter merged 4 commits into
WordPress:trunkfrom
justlevine:docs/filter-param-names
Oct 25, 2026
Merged

westonruter merged 4 commits into
WordPress:trunkfrom
justlevine:docs/filter-param-names

Conversation

@justlevine

Copy link
Copy Markdown
Contributor

What?

This PR fixes an issue with several apply_filters() doc-blocks in WP_Theme_JSON_Resolver_Gutenberg where the @param name was missing.

Why?

While this issue was surfaced by PHPStan (via #66693) it can be remediated independently as part of #66598.

How?

Testing Instructions

Testing Instructions for Keyboard

Screenshots or screencast

Before After

@github-actions

Copy link
Copy Markdown

Warning: Type of PR label mismatch

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Type-related labels to choose from: [Type] Automated Testing, [Type] Breaking Change, [Type] Bug, [Type] Build Tooling, [Type] Code Quality, [Type] Copy, [Type] Developer Documentation, [Type] Enhancement, [Type] Experimental, [Type] Feature, [Type] New API, [Type] Task, [Type] Technical Prototype, [Type] Performance, [Type] Project Management, [Type] Regression, [Type] Security, [Type] WP Core Ticket, Backport from WordPress Core, Gutenberg Plugin.
  • Labels found: .

Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.

@justlevine
justlevine force-pushed the docs/filter-param-names branch from d04f51f to 4afce2f Compare April 18, 2025 22:53
westonruter and others added 3 commits October 24, 2026 21:06
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This matches the documentation of the same four filters in
`WP_Theme_JSON_Resolver` in WordPress core, which named the parameter
`$theme_json` in r56157.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The container property and `get_theme_json()` were documented with core's
`WP_Theme_JSON`, but the constructor always assigns a
`WP_Theme_JSON_Gutenberg`, which is not a subclass of it.

The mistake was hidden while the theme.json data filter docblocks in
`WP_Theme_JSON_Resolver_Gutenberg` failed to parse: with valid `@param`
tags, PHPStan types the filtered value from them, and the wrong return
type surfaced as seven errors where the resolver stores or returns the
result.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

🎉 Props

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: justlevine <justlevine@git.wordpress.org>
Co-authored-by: westonruter <westonruter@git.wordpress.org>

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


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

Updated as activity occurs, without notifying anyone named here. Add the props-bot label to refresh.

@westonruter westonruter added the No Core Sync Required Indicates that any changes do not need to be synced to WordPress Core label Oct 25, 2026
@westonruter

Copy link
Copy Markdown
Member

🤖 Comment by Claude Opus 5.5

Trunk was merged in, and two commits were added:

  • 65ceb9d names the parameter $theme_json rather than $instance, matching the documentation of the same four filters in core's WP_Theme_JSON_Resolver since r56157.
  • 64644e5 corrects WP_Theme_JSON_Data_Gutenberg, whose container property and get_theme_json() were documented as core's WP_Theme_JSON, though the constructor always assigns a WP_Theme_JSON_Gutenberg (not a subclass). This was hidden while the filter docblocks failed to parse: once PHPStan could type the filtered value from the @param tags, the wrong return type surfaced as seven new errors in the resolver.

Together these resolve 10 errors reported at PHPStan level 5, with none introduced. Since the core counterparts are already correct, the No Core Sync Required label was added.

@westonruter westonruter added the [Type] Code Quality Issues or PRs that relate to code quality label Oct 25, 2026
@westonruter
westonruter merged commit cc26f7b into WordPress:trunk Oct 25, 2026
95 of 97 checks passed
@github-actions github-actions Bot added this to the Gutenberg 24.4 milestone Oct 25, 2026
@ingeniumed ingeniumed added the Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json label Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json No Core Sync Required Indicates that any changes do not need to be synced to WordPress Core [Type] Code Quality Issues or PRs that relate to code quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants