Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reciprocal Relationships? #55

Open
forwardtrends opened this issue Apr 3, 2018 · 4 comments
Open

Reciprocal Relationships? #55

forwardtrends opened this issue Apr 3, 2018 · 4 comments
Assignees

Comments

@forwardtrends
Copy link

Is there a way to use the relationship both ways (reciprocal)?

For instance lets say I have 2 CPTs - cars and car parts.

So when editing a car, you can drag the part or parts to attach them.

When editing a part, is there a way I can see and manage all the cars that are already attached to it?

I can write a function to do this - just looking for a shortcut if it's already built in somehow. Thanks

@jtsternberg
Copy link
Member

It is not currently a thing, but is something I've been planning to do/document for ages. Did you build something?

@forwardtrends
Copy link
Author

Just on the front end by querying postmeta for the related post IDs

$rows = $wpdb->get_results( "SELECT * FROM wp_postmeta WHERE (meta_key= 'yourkey_attached_parts' ANDmeta_value LIKE '%".$current_post_id."%')");

@edvind
Copy link

edvind commented Jun 18, 2018

This would be a fantastic feature to have. +1

@tnorthcutt
Copy link

This seems to maybe be a duplicate of #28, or at least relate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants