Skip to content
  • Log In
  • Register
WordPress.org
  • News
  • Download & Extend
    • Get WordPress
    • Themes
    • Patterns
    • Plugins
    • Openverse
    • Mobile
    • Hosting
  • Learn
    • Learn WordPress
    • Documentation
    • Forums
    • WordPress.tv
    • Developers
  • Community
    • Make WordPress
    • WordCamp
    • Meetups
    • Photo Directory
    • Job Board
    • Five for the Future
  • About
    • About WordPress
    • Showcase
    • Gutenberg
    • Enterprise
    • WordPress Swag Store
  • Get WordPress
Get WordPress
Menu

Make WordPress Core

  • Tickets
  • Components
  • Handbook
  • Browse Source
  • Trac Timeline
  • Create a New Ticket

Welcome!

The WordPress coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress. development team builds WordPress! Follow this site for general updates, status reports, and the occasional code debate. There’s lots of ways to contribute:

  • Found a bugbug A bug is an error or unexpected result. Performance improvements, code optimization, and are considered enhancements, not defects. After feature freeze, only bugs are dealt with, with regressions (adverse changes from the previous version) being the highest priority.? Create a ticket in our bug tracker.
  • Want to contribute? Get started quickly with our tickets marked as good first bugs for new contributors or join a bug scrub. There’s more on our reports page, like patches needing testing, and on our feature projects page.
  • Other questions? We also have a detailed handbook for contributors, complete with tutorials.

Communication

We use Slack for real-time communication. Contributors live all over the world, so there are discussions happening at all hours of the day.

Our core development meetings are every Wednesday at 20:00 UTC in the #core channel on Slack. Anyone can join and participate or listen in!

      Boone Gorges 9:32 pm on March 30, 2015
      Tags: 4.2 ( 67 ), dev-notes ( 472 ), post meta ( 2 ), query ( 8 )   

      Query improvements in WP 4.2: ‘orderby’ and ‘meta_query’

      WP 4.2 will include a number of improvements in the way query classes handle ‘orderby’, particularly when used in connection with the ‘meta_query’ parameter.

      WP_Query has long supported the sorting of results by postmeta, using the following syntaxes:

      $q1 = new WP_Query( array(
          'meta_key' => 'foo',
          'orderby' => 'meta_value',
      ) );
      
      $q2 = new WP_Query( array(
          'meta_key' => 'foo',
          'orderby' => 'foo',
      ) );
      

      These arguments have always operated more or less independently from ‘meta_query’. Internally, ‘meta_key’ and ‘meta_value’ are converted to the first clause in a ‘meta_query’, but this conversion is opaque as far as ‘orderby’ is concerned.

      WP 4.2 will address this shortcoming with a new syntax for ordering by specific clauses of a ‘meta_query’ array. When building the ‘meta_query’ parameter, use explicit array indexes for the metaMeta Meta is a term that refers to the inside workings of a group. For us, this is the team that works on internal WordPress sites like WordCamp Central and Make WordPress. query clauses. These indexes will be used as handles, which can be referenced from the ‘orderby’ param. For example:

      $q = new WP_Query( array(
          'meta_query' => array(
              'relation' => 'AND',
              'state_clause' => array(
                  'key' => 'state',
                  'value' => 'Wisconsin',
              ),
              'city_clause' => array(
                  'key' => 'city',
                  'compare' => 'EXISTS',
              ), 
          ),
          'orderby' => 'city_clause', // Results will be ordered by 'city' meta values.
      ) );
      

      This new syntax can be used in conjunction with complex ‘orderby’ parameters:

      // ...
          'orderby' => array(
              'city_clause' => 'ASC',
              'state_clause' => 'DESC',
          ),
      // ...
      

      See #31045 for more background.

      We’ve also done a sweep through WP’s primary query classes – WP_Query, WP_User_Query, and WP_Comment_Query – to ensure that ‘orderby’ can be used in the same way everywhere. As of 4.2, ‘orderby’ syntax – including multidimensional arrays, ‘meta_value_num’, and the meta query index references described above – is the same in each of these three query classes. See #31265.

      #4-2, #dev-notes, #post-meta, #query

      Share this:

      • Twitter
      • Facebook
          1. Flynn O'Connor 9:40 pm on March 30, 2015

            That’s awesome. Big thanks to Manny Fleurmond and Boone for adding this.

          2. Manny Fleurmond 10:05 pm on March 30, 2015

            I’m just glad it made it into coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress..

          3. Evan Stein 1:35 am on March 31, 2015

            This is really cool!!!

          4. Hugh Lashbrooke 6:55 am on March 31, 2015

            Been watching this for a while and super stoked to see it in coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress.. Really awesome work 🙂

          5. Maruti Mohanty 7:57 am on March 31, 2015

            Awesome!!! Thanks for adding this to the coreCore Core is the set of software required to run WordPress. The Core Development Team builds WordPress.. Cheers to the team (y)

          6. Subharanjan 8:05 am on March 31, 2015

            Really helpful. Thanks !! 🙂

          7. Franz Josef Kaiser 8:40 am on March 31, 2015

            Rock’n’Roll

          8. leemon 11:43 am on March 31, 2015

            Great! Thanks!

          9. websupporter 12:01 pm on April 1, 2015

            Great work! I will give it a try as soon as possible 🙂

          10. Piet Bos 2:11 am on April 3, 2015

            super!

          11. ljkeashly 6:49 pm on April 30, 2015

            Can you please provide a more complex orderby by example. Using a custom fieldCustom Field Custom Field, also referred to as post meta, is a feature in WordPress. It allows users to add additional information when writing a post, eg contributors’ names, auth. WordPress stores this information as metadata. Users can display this meta data by using template tags in their WordPress themes. to sort the data and then another custom field, but not of the custom fields in the meta_query/where clause.
            So order by custom_status field and say a custom_date field for example.
            Thank you.

          12. Thierry Pigot 2:58 pm on May 7, 2015

            Nice job, Thanks 😉

          Comments are closed.

          Post navigation

          ← WordPress Core Weekly
          Screen Reader Text in output of comments_popup_link →

          Email Updates

          Enter your email address to subscribe to this blog and receive notifications of new posts by email.

          Join 5,539 other subscribers
          • Recent Updates
          • Recent Comments
          • No Replies

          Current Release

          The current release in progress is WordPress 6.2.

          Planned future releases are listed on the Project Roadmap.

          Feature projects not tied to specific releases can be found on the Features page.

          Regular Chats

          Note: All chats happen on Slack.
          • Weekly Developer Meetings: Wednesday 20:00 UTC in #core
          • About the Dev Chat
          • Agendas | Summaries

          • APAC Triage Sessions Tuesday 5:00 UTC alternating between #core and #core-editor
          • JavaScript Weekly Chat Tuesday 14:00 UTC in #core-js
          • Multisite Weekly Chat Tuesday 17:00 UTC in #core-multisite
          • REST API Weekly Chat Thursday 18:00 UTC in #core-restapi
          • Editor Weekly Chat Wednesday 14:00 UTC in #core-editor
          • New Contributors Chat Wednesday 19:00 UTC in #core
          • Images/Media Weekly Chat Thursday 15:00 UTC in #core-media
          • CSS Weekly Chat Thursday 21:00 UTC in #core-css
          • Customize Weekly Chat Monday 19:00 UTC in #core-customize

          See all meetings →

          Recent Posts and Comments

          Team Pledges

          1825 people have pledged time to contribute to Core Team efforts! When looking for help on a project or program, try starting by reaching out to them!

          • About
          • News
          • Hosting
          • Donate
          • Swag
          • Documentation
          • Developers
          • Get Involved
          • Learn
          • Showcase
          • Plugins
          • Themes
          • Patterns
          • WordCamp
          • WordPress.TV
          • BuddyPress
          • bbPress
          • WordPress.com
          • Matt
          • Privacy
          • Public Code
          WordPress.org
          WordPress.org
          • Visit our Facebook page
          • Visit our Twitter account
          • Visit our Instagram account
          • Visit our LinkedIn account
          Code is Poetry
          s
          search
          c
          compose new post
          r
          reply
          e
          edit
          t
          go to top
          j
          go to the next post or comment
          k
          go to the previous post or comment
          o
          toggle comment visibility
          esc
          cancel edit post or comment