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’.

visit Make WordPress Core

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog at WordPress.com.

Up ↑

%d bloggers like this: