Using 'connected_query' to filter both ends of multiple connections
-
Hi Sribu,
The new ‘connected_query’ variable has been very useful. I’m currently using it to filter both ends of a connection, but is there a way to filter both ends of multiple connections? For instance, if I had pages connected to posts and a custom post type, it would be nice if we could do something like this:
$pages = new WP_Query( array( 'post_type' => 'page', 'connected_query' => array( array( 'connected_type' => 'pages_to_posts', 'connected_to' => 'any', 'category_name' => 'tutorials', ), array( 'connected_type' => 'pages_to_customtype', 'connected_to' => 'any', 'tax_query' => array( array( 'taxonomy' => 'people', 'field' => 'slug', 'terms' => 'bob' ) ) ) ), 'nopaging' => true ) );
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Using 'connected_query' to filter both ends of multiple connections’ is closed to new replies.