scribu/wp-posts-to-posts — Issue #74: Query connection chains
Author: scribu
Created: 2011-12-01 19:15:53+00:00
State: open
Labels: feature

A generalized way of getting indirect connections:

```php
$query = new WP_Query( array(
'connected_chain' => array( 'series_to_seasons', 'seasons_to_episodes', 'episodes_to_actors' )
'connected_items' => $serie_id
) );
```

Each element in the 'connected_chain' array would be a connection type and the query would return all the actors involved.

P2P_Connected_Type::get_related() would then just be a special case:

```php
...
'connected_chain' => array( 'posts_to_pages', 'posts_to_pages' )
...
```