scribu/wp-posts-to-posts — Issue #90: to_query_vars doesn't seem to work properly in UI
Author: ctalkington
Created: 2011-12-23 21:33:40+00:00
State: open

I am using the following code with the latest version and while it appears to hide the users with position == wordpress from the connected items list. It doesn't actually prevent me from adding them from the "All" users list. Once added, you can't remove the connection without removing the to_query_vars params. I have to wonder if this is intentional or if there is anything that be done to only show users in the "All" list that meet such criteria. Great plugin overall though.

```php
p2p_register_connection_type(array(
'name' => 'fci_department_to_users',
'from' => 'fci_department',
'to_object' => 'user',
'to_query_vars' => array(
'meta_key' => 'fci_position',
'meta_value' => 'wordpress',
'meta_compare' => '!='
)
));
```