-
Notifications
You must be signed in to change notification settings - Fork 262
Query vars
scribu edited this page Jul 8, 2012
·
18 revisions
Here is a list of all the arguments that you can pass to WP_Query
or to get_users()
, to get a list of connected items:
'connected_type' => 'posts_to_pages'
'connected_type' => array( 'posts_to_pages', 'pages_to_pages' )
'connected_items' => $post
'connected_items' => array( $post_1, $post_2, ... )
'connected_items' => 'any'
Optional, inferred from 'connected_type'
+ 'connected_items'
.
'connected_direction' => 'from'
'connected_direction' => 'to'
'connected_direction' => 'any'
Shortcuts:
-
'connected' => $posts
maps to'connected_items' => $posts, 'connected_direction' => 'any'
-
'connected_to' => $posts
maps to'connected_items' => $posts, 'connected_direction' => 'to'
-
'connected_from' => $posts
maps to'connected_items' => $posts, 'connected_direction' => 'from'
'connected_meta' => array(
$meta_key => $meta_value
)
or
'connected_meta' => array(
array(
'key' => $meta_key,
'value' => $meta_value,
'compare' => '<'
)
)
The second syntax is the same as for 'meta_query': http://codex.wordpress.org/Class_Reference/WP_Query#Custom_Field_Parameters
'connected_orderby' => $meta_key
'connected_order' => 'asc' or 'desc'
'connected_order_num' => true or false
... where $meta_key
is a connection custom field.
When the connection type has 'sortable' => true
, the order arguments are automatically set.