Skip to content

Skip array parameter block content from main description#26

Merged
akirk merged 1 commit intomainfrom
fix/skip-param-block-content
Jan 30, 2026
Merged

Skip array parameter block content from main description#26
akirk merged 1 commit intomainfrom
fix/skip-param-block-content

Conversation

@akirk
Copy link
Copy Markdown
Owner

@akirk akirk commented Jan 30, 2026

Summary

WordPress array parameter documentation uses { } blocks after @param:

@param array $args {
    Description of array members.
    @type string $name Name.
}

Lines inside this block (except @type tags) were being added to the main hook description, causing "Term arguments." and } to appear in the wrong place.

This fix tracks when we're inside such a block and skips non-tag lines.

Before

Filter term arguments before creating the term.

Term arguments.

}

## Auto-generated Example

After

Filter term arguments before creating the term.

## Auto-generated Example

See multiple_type_tags_hook for a live example.

Test plan

  • Run vendor/bin/phpunit - all 48 tests pass
  • Run vendor/bin/phpcs - no style violations

WordPress array parameter documentation uses { } blocks after @param:

    @param array $args {
        Description of array members.
        @type string $name Name.
    }

Lines inside this block (except @type tags) were being added to the
main hook description, causing "Term arguments." and "}" to appear
in the wrong place.

This fix tracks when we're inside such a block and skips non-tag lines.
@akirk akirk merged commit a315dd5 into main Jan 30, 2026
2 checks passed
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.

1 participant