-
Notifications
You must be signed in to change notification settings - Fork 261
Connection ordering
scribu edited this page Oct 27, 2011
·
17 revisions
Since version 0.9, when registering a connection type, you can set the 'sortable' flag:
p2p_register_connection_type( array(
'id' => 'posts_to_pages',
'from' => 'post',
'to' => 'page',
'sortable' => 'order'
) );
This will make the connection rows sortable via drag-and-drop. The ordering information will be stored in the 'order' connection field and will automatically be used when calling p2p_type( 'posts_to_pages' )->get_connected()
.
Note that since reciprocal connections are only stored once, ordering will only work one way.