WordPress / Documentation-Issue-Tracker

Issue Tracker for the WordPress Documentation team.
https://make.wordpress.org/docs/
Other
77 stars 39 forks source link

Wrong variable name in filter documentation for `comments_clauses` hook #1572

Open itzmekhokan opened 3 months ago

itzmekhokan commented 3 months ago

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

github-actions[bot] commented 3 months ago

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