Skip to content

Docs: Add the missing $has_custom_overlay param to the Navigation block DocBlock#12640

Closed
itzmekhokan wants to merge 1 commit into
WordPress:trunkfrom
itzmekhokan:fix/65691-navigation-overlay-styles-docblock
Closed

Docs: Add the missing $has_custom_overlay param to the Navigation block DocBlock#12640
itzmekhokan wants to merge 1 commit into
WordPress:trunkfrom
itzmekhokan:fix/65691-navigation-overlay-styles-docblock

Conversation

@itzmekhokan

@itzmekhokan itzmekhokan commented Jul 22, 2026

Copy link
Copy Markdown

Trac ticket

https://core.trac.wordpress.org/ticket/65691

Description

WP_Navigation_Block_Renderer::get_overlay_inline_styles(), introduced in WordPress 7.0.0, documented only its second parameter, $colors. Its first parameter, $has_custom_overlay, had no @param entry.

This adds the missing @param bool $has_custom_overlay tag in signature order, with columns aligned per the WordPress PHP documentation standards. The description matches the sibling method get_responsive_container_classes(), which documents the same parameter.

Documentation-only change; no behavior is affected.

…lock DocBlock.

`WP_Navigation_Block_Renderer::get_overlay_inline_styles()`, introduced
in WordPress 7.0.0, documented only its second parameter, `$colors`. Its
first parameter, `$has_custom_overlay`, had no `@param` entry. This adds
the missing tag in signature order, per the WordPress PHP documentation
standards.

Fixes #65691.
Copilot AI review requested due to automatic review settings July 22, 2026 12:37
@github-actions

github-actions Bot commented Jul 22, 2026

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 khokansardar, westonruter.

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates inline PHPDoc for the Navigation block renderer to properly document the full WP_Navigation_Block_Renderer::get_overlay_inline_styles() method signature (introduced in WP 7.0.0), aligning the documentation with WordPress PHPDoc standards and the adjacent/sibling method’s parameter meaning.

Changes:

  • Adds the missing @param bool $has_custom_overlay tag to get_overlay_inline_styles().
  • Orders the @param tags to match the function signature and aligns columns per WP doc standards.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@westonruter westonruter left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests are failing because this file is managed in the Gutenberg repo. You'll need to make the fix there:

https://github.com/WordPress/gutenberg/blob/918c8c60f98cfdd0427f4d30615873dbad538089/packages/block-library/src/navigation/index.php#L707-L718

*
* @param array $colors The colors array.
* @param bool $has_custom_overlay Whether a custom overlay is used.
* @param array $colors The colors array.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we're touching the docblock here, we should take the opportunity to provide the full PHPStan typing for this param. So this could be done by adding another tag at the bottom of the docblock:

* @phpstan-param array{
*     overlay_inline_styles: string,
* } $colors

@itzmekhokan

Copy link
Copy Markdown
Author

Thanks for the review @westonruter, and for pointing out that this file is managed in the Gutenberg repo.

I've moved the fix there: WordPress/gutenberg#80622

Both pieces of feedback are addressed in that PR:

  • The missing @param bool $has_custom_overlay tag on get_overlay_inline_styles(), in signature order with aligned columns.
  • The @phpstan-param array shape for $colors, added exactly as you suggested.

I also applied the same treatment to the sibling get_responsive_container_classes(), which had the same column misalignment and reads overlay_css_classes (typed as list<string>, since it is passed to implode()). Happy to drop that part if you would rather keep the change narrowly scoped to the one method.

Shall I close this PR in favour of the Gutenberg one, or leave it open until the change syncs back to Core?

@westonruter

Copy link
Copy Markdown
Member

Yes, this should be closed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants