WordPress.org

Ready to get started?Download WordPress

Forums

Posts 2 Posts
How to dynamically filter the results in the Admin Box. (3 posts)

  1. darlantc
    Member
    Posted 6 months ago #

    I'm using P2P to link two CPT. I already connected the two CPT but the default admin box can't fit my needs. Imagine this scenario:

    CPT 1 have a custom field of YES or NO choice (0 or 1 in database) and is the FROM for P2P.

    In the CPT 2 I need a custom box for P2P with a select field (YES, NO or BOTH) that filters the results that the P2P brings to connect. Like if Yes is selected the results should show only posts from CPT 1 that contains the custom field market at YES, and vice-versa, dynamically when user is creating a new post in CPT two.

    I'm new to PHP and WordPress development and don't know where to start that...

    http://wordpress.org/plugins/posts-to-posts/

  2. tedinoz
    Member
    Posted 5 months ago #

    I think the starting point is (if you haven't done so already) is to define the metadata fields within the register_connection_types statement.

    Would you show your code for the connections?

    Ted

  3. darlantc
    Member
    Posted 3 months ago #

    Thanks for your reply Ted.

    After hours of study I did the work without using the P2P.

    Regards!

Reply

You must log in to post.

About this Plugin

About this Topic