WordPress.org

Ready to get started?Download WordPress

Forums

Posts 2 Posts
Connect Post to Post-in-Specific-Taxonomy (1 post)

  1. jdsteinbach
    Member
    Posted 4 months ago #

    I'd like to be able to connect one post to another post, but only allow users to select posts from a specific post category in that connections box. I looked through the P2P docs on GitHub and didn't find instructions for this behavior.

    Here's a fuller explanation: I have a custom post type called Products. It's got three categories in a custom taxonomy ('product-category'): Case, Battery, Display. Most users will start with a display, then they must choose a compatible case & battery in order to complete their product configuration. I want to put two connection boxes on the product page: Compatible Battery & Compatible Case (or Compatible Display, if they start on a case / battery product page), so those boxes need to be reciprocal connections for [product(product-category=case) - product(product-category=display)], [product(product-category=battery) - product(product-category=display)], and [product(product-category=case) - product(product-category=battery)].

    I know I could do this by creating 3 post types, but that will triple the number of theme template files for products & add unnecessary sections the dashboard so I don't want to go that route.

    Is there a parameter I can add to p2p_register_connection_type() to accomplish this?

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

Reply

You must log in to post.

About this Plugin

About this Topic