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

Warning for usage of query_posts() in favor of WP_Query #723

Open
ernilambar opened this issue Oct 16, 2024 · 0 comments · May be fixed by #724
Open

Warning for usage of query_posts() in favor of WP_Query #723

ernilambar opened this issue Oct 16, 2024 · 0 comments · May be fixed by #724
Assignees
Labels
[Team] Plugin Review Issues owned by Plugin Review Team [Type] Enhancement A suggestion for improvement of an existing feature

Comments

@ernilambar
Copy link
Member

Show warning for usage of query_posts() in favor of WP_Query. Similarly warn usage of wp_reset_query() in favor of wp_reset_postdata()

We could use DiscouragedFunctions sniff from WPCS to achieve this.

<rule ref="WordPress.WP.DiscouragedFunctions">
  <severity>6</severity>
</rule>
@ernilambar ernilambar added [Team] Plugin Review Issues owned by Plugin Review Team [Type] Enhancement A suggestion for improvement of an existing feature labels Oct 16, 2024
@ernilambar ernilambar linked a pull request Oct 18, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Team] Plugin Review Issues owned by Plugin Review Team [Type] Enhancement A suggestion for improvement of an existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant