Query component

The Query component includes the following:

  • WP_Query, WP_User_Query, and WP_Comment_Query. These are the three APIs that WordPress offers for constructing complex data queries.
  • Template functions used to deterimine the kind of page currently being requested. These are the is_*() functions – is_month(), is_single(), and so on.
  • WP_Meta_Query, WP_Tax_Query, and WP_Date_Query. These are helper classes, used by the main query classes as well as third-party plugins, to construct SQL clauses related to metadata, taxonomy terms, and date ranges.

Projects for future releases

  • Improved caching. Most queries are currently cached at the level of individual items (posts, users, etc), but the IDs that result from the query are uncached. See #22176 for an example.
  • The query classes, and particularly WP_Query, contain lots of legacy code that causes problems in edge cases, makes unit testing difficult, and so on. There are various initiatives underway to clean up some of these problems. See #30911 for an example related to post_status.

 

Recent posts on the make/core blog

View all posts tagged query.

170 open tickets in the Query component

170 open tickets defect (bug) enhancement feature request
1 0 0
5.2 2 1 1
Awaiting Review 77 56 6
Future Release 11 14 1

170 open tickets. Last 7 days: +0 tickets

32 tickets that have no replies

View list on Trac

  • #39428  Die fast in get_posts if get_user_by returns false
  • #39447  Improvment to the get_the_posts_navigation
  • #39632  Adding Query identifier attribute ui
  • #39818  Bulk Publishing Posts (from Pending State) Causes Pagination To Break
  • #39914  'orderby' date results differs depend on 'post_status'
  • #40300  `title` parameter causes `WP_Query` to return sticky posts.
  • #40327  Wrong SQL request for 'EXIST' OR 'NOT EXIST' on same post meta
  • #40341  Make search possible in custom fields
  • #40404  Slow queries with a large number of posts (tens of thousands and above) performance
  • #40903  Filtered posts_request query can break found_posts query
  • #40984  Possible Bug with Named Orderby Meta Query SQL
  • #41678  Make sure all field returns use filters in WP Query performance
  • #41700  New filter return in WP_Query performance
  • #41843  Provide more flexibility to the `get_{$adjacent}_post_where` hook
  • #42082  Support compare custom fields in WP_Meta_Query
  • #42732  Problem with usage of WP_Term_Query inside WP_Tax_Query
  • #43324  query_vars is not necessarely representative of the final query_vars used to build the SQL query
  • #43445  Wildcard `LIKE` support for `WP_Meta_Query` (and maybe other queries?)
  • #43634  WP_Query returns wrong result if 10+ search terms and all negative.
  • #43831  parse_order method of WP_Query class.
  • #43842  get_children() function enhancement.
  • #44372  WP_Query cannot properly order by nested Parent/Child relationships
  • #44519  Where are the pages of the headings added with the + add-on (any) ala https://wp-kama.ru/cat/wordpress/codex+xxx
  • #44602  meta_query to support FIND_IN_SET
  • #44695  WP_Term_Query unexpected 'orderby' behaviour.
  • #44737  WP_Query: in searches post_status should consider exclude_from_search
  • #44964  `redirect_guess_404_permalink` doesn't support array in `post_type` var
  • #45084  WP_Term_Query multiple 'orderby' support
  • #45376  Search not working as described in codex
  • #45400  last of query_vars contains anchor
  • #46285  Search colums of WP User Query vars is not updated after applying user_search_columns filter
  • #46347  WP_Term_Query where sql_clauses oddity

4 tickets slated for 5.2

View list in Trac

  • #43446  `meta_compare_key` should support more operators than `LIKE` and `=`
  • #44296  Enable double-width space works as a separator in search query
  • #44658  Support BETWEEN for term names in WP_Tax_Query/WP_Term_Query
  • #44965  WordPress Core strips $_GET['error'] occasionally

170 open tickets

Open bugs: 91. View list on Trac

Help maintain this component

Component maintainers:

Many contributors help maintain one or more components. These maintainers are vital to keeping WordPress development running as smoothly as possible. They triage new tickets, look after existing ones, spearhead or mentor tasks, pitch new ideas, curate roadmaps, and provide feedback to other contributors. Longtime maintainers with a deep understanding of particular areas of core are always seeking to mentor others to impart their knowledge.

Want to help? Start following this component! Adjust your notifications here. Feel free to dig into any ticket.

Contributors following this component: