scribu/wp-posts-to-posts — Issue #109: sortable reciprocal
Author: taavo
Created: 2012-02-10 15:32:18+00:00
State: open

The documentation seems to be incorrect where it says "[ordering is not available for reciprocal connections](https://github.com/scribu/wp-posts-to-posts/wiki/Connection-ordering)". This appears to be working for me:

```
p2p_register_connection_type(
array(
'name' => 'project_services',
'from' => 'project',
'to' => 'service',
'reciprocal' => true,
'sortable' => 'to'
));
```

- Projects are ordered correctly on the Edit Service admin screen, and drag/drop works.
- Projects are ordered correctly on the front end (single-service.php) using:
```
$projects_query = p2p_type('project_services')->get_connected(get_queried_object_id());
p2p_list_posts($projects_query);
```
- The only odd thing is that Services appear to be sortable on the Edit Project admin screen, despite the fact that sortable is "to". (When I experimented with 'sortable' => 'from', Services were sortable on Edit Project, but Projects were not sortable on Edit Service.)

Should I expect this to explode in a future version of wp_p2p, or is this an undocumented feature?

(And thanks for the plugin. The clarity of your code is excellent; it's a shame the WP core isn't as clean or well tested.)