Skip to content

[DevHub] Wrong variable name in filter documentation for comments_clauses hook #1572

@itzmekhokan

Description

@itzmekhokan

In r52974 some $pieces variables were changed to $clauses including the usage in docblocks. However, some of the instances were reverted back to $pieces in r53376 but the docblocks were intact creating possibly mis-leading docblocks.

Issue Description

In filter $clauses = apply_filters_ref_array( 'comments_clauses', array( compact( $pieces ), &$this ) ); documentation there is mentioned variable parameter as $clauses and used in filter as $pieces.

URL of the Page with the Issue

(https://developer.wordpress.org/reference/hooks/comments_clauses/)

Section of Page with the issue

Documentation parameter mentioned is not macting with the variable used in filter hook - https://github.com/WordPress/wordpress-develop/blob/a1b1e0339eb6dfa72a30933cac2a1c6ad2bbfe96/src/wp-includes/class-wp-comment-query.php#L930

Why is this a problem?

Hook filter documention mis leading with filter params which can confuse the developer.

Suggested Fix

I would suggest the previous fixes commit
There already has a ticket with this issue mentioned in core

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions