WordPress.org

Ready to get started?Download WordPress

Forums

Posts 2 Posts
Show in admin UI only children (7 posts)

  1. IoanPokorny
    Member
    Posted 1 year 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/

  2. scribu
    Member
    Plugin Author

    Posted 1 year ago #

    Why not make two separate post types: 'company' and 'employee'

  3. IoanPokorny
    Member
    Posted 1 year 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

  4. scribu
    Member
    Plugin Author

    Posted 1 year ago #

    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

  5. IoanPokorny
    Member
    Posted 1 year ago #

    Thank you for your fast and prompt response,
    honestly I don't know how I could use that filter

  6. IoanPokorny
    Member
    Posted 1 year ago #

    What function is there used to echo the results in the admin box?

  7. IoanPokorny
    Member
    Posted 1 year 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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.