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

replace "wp_reset_query" with wp_reset_postdata #81

Open
kniebremser opened this issue Jun 11, 2019 · 0 comments
Open

replace "wp_reset_query" with wp_reset_postdata #81

kniebremser opened this issue Jun 11, 2019 · 0 comments

Comments

@kniebremser
Copy link
Collaborator

kniebremser commented Jun 11, 2019

phpcs brings the message:
wp_reset_query() is discouraged. Use the with wp reset postdata() instead.

References:
https://codex.wordpress.org/Function_Reference/wp_reset_query
https://codex.wordpress.org/wp_reset_postdata

wp_reset_query() is used several times in the plugin.

In functions/diplaypost.php line36 is wp_reset_query();

In taxonomy-characters.php line 50 is wp_reset_query();
In taxonomy-locations.php line 21 is wp_reset_query();
In taxonomy-locations.php line 52 is wp_reset_query();

I'm surprised both files have the same structure but in one file the function is called only once and twice in the other

In blog.php both are in a row
In blog.php line 33 is wp_reset_postdata();
In blog.php line 34 is wp_reset_query();

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

No branches or pull requests

1 participant