I'm writing an app that is basically a collection of publications, each with a collection of articles (effectively a blog network).
Each user can own one publication. Each publication can have multiple articles (articles are CPT).
At first I set it up with the publication as a taxonomy. But now I've gone to add extra fields to it (such as description, image etc), I'm struggling to get it to work. The same code works fine for creating a metabox for the article CPT.
Is this a totally stupid way of doing it?
Should I use Metabox Relationships instead and create a CPT for the publication and link them to the articles CPT instead?
Use the publication as a taxonomy is a good way for your case. WordPress supports more functions to get the taxonomy and is easier than using a relationship.
To add extra fields to the taxonomy, you can use the extension MB Term Meta
Brilliant, thanks Long. I thought it was the right way originally - and I am already using MB Term Meta - but then I had a wobble because when it came to adding the custom fields in code I was trying to do it exactly the same as with a CPT. I'd simply forgotten to look at the MB Term Meta documentation again.
Obviously this is my fault, but if I have one issue with working with MetaBox it's the fact so much is split over so many different plugins and I find it hard to remember to look in the right place to find something when, to my mind, it's all part of the same system but documentation-wise it's in different places.
Thanks so much, I thought I'd have to redo a lot of work - but now I just need to make that " 'taxonomies' => 'category', " change to my code basically!
Sorry Long, but is it possible to display/edit the custom taxonomies on the front end using Frontend Submission? So far it doesn't seem to work and a search of the forum seems to suggest that, at least as of last year, it wasn't possible.
This is something users need to set themselves. Am I better using MB User Meta for the front end form and then creating/editing the taxonomies in a post save filter ?
The taxonomy and term meta are not supported to create or edit on the frontend. You can try to use the extension MB Relationships so you can create posts on the frontend and select the relation posts as well.
Thanks. I'm going to use my own form and code to do it and create or edit the taxonomy on submit.