Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong variable name in filter documentation for comments_clauses hook #1572

Open
itzmekhokan opened this issue May 29, 2024 · 1 comment
Open
Labels
developer documentation (DevHub) Improvements or additions to developer documentation [Status] To do Issue marked as Todo

Comments

@itzmekhokan
Copy link

itzmekhokan commented May 29, 2024

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

@itzmekhokan itzmekhokan added the [Status] To do Issue marked as Todo label May 29, 2024
Copy link

Heads up @WordPress/docs-issues-coordinators, we have a new issue open. Time to use 'em labels.

@estelaris estelaris added the developer documentation (DevHub) Improvements or additions to developer documentation label Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
developer documentation (DevHub) Improvements or additions to developer documentation [Status] To do Issue marked as Todo
Projects
None yet
Development

No branches or pull requests

2 participants