[wp-trac] [WordPress Trac] #36874: Depreciation of query_posts()
WordPress Trac
noreply at wordpress.org
Wed May 18 05:27:12 UTC 2016
#36874: Depreciation of query_posts()
-----------------------------+-----------------------------
Reporter: pietergoosen | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Query | Version: 4.5.2
Severity: normal | Keywords:
Focuses: |
-----------------------------+-----------------------------
{{{query_posts()}}} alters/breaks the main query, and if not properly
reset, leads to many issues with other functions and code. Just how bad
{{{query_posts()}}} really is, one can check
[http://wordpress.stackexchange.com/q/1753/31545 this complete post on
WPSE].
It is widely accepted, and also recommended to use {{{pre_get_posts}}} to
alter the main query and {{{WP_Query}}} or {{{get_posts}}} to run
secondary queries.
{{{query_posts()}}} can therefor be depreciated in favor of any of the
above mentioned actin/class/function as {{{query_posts}}} should never be
used to run any type of query due to the fact that it breaks the main
query and also reruns queries which makes slow pages down.
Can we depreciate {{{query_posts()}}} with the proper debug message that
one should rather use any of the above mentioned methods to alter the main
query or to run secondary queries
--
Ticket URL: <https://core.trac.wordpress.org/ticket/36874>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list