comicpress icon indicating copy to clipboard operation
comicpress copied to clipboard

replace "wp_reset_query" with wp_reset_postdata

Open kniebremser opened this issue 5 years ago • 0 comments

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();

kniebremser avatar Jun 11 '19 21:06 kniebremser