Open cggit opened 7 years ago
Not sure I follow. Please elaborate. You should be able to get any data you need using the id that's stored.
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.
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.
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.
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.
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?
I gave it a go and made a pull request. It works but maybe you can suggest improvements.
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.