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

Adding relationship label to attached posts #38

Open
cggit opened this issue Apr 6, 2017 · 7 comments
Open

Adding relationship label to attached posts #38

cggit opened this issue Apr 6, 2017 · 7 comments

Comments

@cggit
Copy link

cggit commented Apr 6, 2017

Is it feasible to add relationship labels to the post connections?

Eg. Having a text input field in the attached posts list and storing the text along with the post ID.

@jtsternberg
Copy link
Member

Not sure I follow. Please elaborate. You should be able to get any data you need using the id that's stored.

@cggit
Copy link
Author

cggit commented Apr 6, 2017

I'd like to label the relationships between attached posts.

Eg. An actors role in a movie where the actor IDs are stored along with their role in the movie's attached post meta.

The only plugin that I've seen do something similar is the no longer supported Post 2 Post which I believe creates a relationship post type and attaches meta data to it for labels.

@jtsternberg
Copy link
Member

Ah, I see what you're saying. Yah, that's def. not something this plugin does, and would require some custom coding to make happen.

@cggit
Copy link
Author

cggit commented Apr 6, 2017

Would you be able to outline in a few words how one could go about integrating this functionality?

I can code but am not very familiar with the CMB2 core. Any guidance is appreciated.

@jtsternberg
Copy link
Member

I'm afraid it would not be a trivial undertaking and would take more than a few words. Basically, you'd have to add the UI to add the label field, then add the JS or php or whatever to process those fields and make sure they are associated with the ids.

@cggit
Copy link
Author

cggit commented Apr 7, 2017

Once I have the UI serving relationship labels in $_POST is there a recommended CMB2 hook to add or merge new meta with the existing attached_post meta?

@cggit
Copy link
Author

cggit commented Apr 8, 2017

I gave it a go and made a pull request. It works but maybe you can suggest improvements.

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

No branches or pull requests

2 participants