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

  1. darlantc
    Posted 2 years 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...


  2. tedinoz
    Posted 2 years 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?


  3. darlantc
    Posted 2 years ago #

    Thanks for your reply Ted.

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


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Posts 2 Posts
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic