IoanPokorny
Member
Posted 3 months ago #
I have made a custom post type called directory where I have
Company (parent post) -> individuals (children).
I want in my 'to' connection to be able to select only individuals not companies (get only children posts listed).
How can I achieve this?
http://wordpress.org/extend/plugins/posts-to-posts/
Why not make two separate post types: 'company' and 'employee'
IoanPokorny
Member
Posted 3 months ago #
Can't I query in my admin box only child pages (eg depth: -1) ? The entire site custom coding is laid on that format
You can alter the query used by the metabox using the 'p2p_connectable_args' filter:
https://github.com/scribu/wp-posts-to-posts/wiki/Admin-box-filters
IoanPokorny
Member
Posted 3 months ago #
Thank you for your fast and prompt response,
honestly I don't know how I could use that filter
IoanPokorny
Member
Posted 3 months ago #
What function is there used to echo the results in the admin box?
IoanPokorny
Member
Posted 3 months ago #
Perhaps, if that it's way out of reach, is it possible to put a conditional somewhere (even if needs entering into plugins code), for example to display a specific post only if custom-field['test']==1, or anything I could wrap arround