Support › MB Relationships › Show data from related post/term after selection
I'm trying to create a display on an Admin Edit Post form that will show meta from a relational field after the related post/term is selected.
Is there a built-in way to do this?
If not, Any tips on creating this? (I'm guessing I'll use JS to make a custom request to get the data and populate a Custom HTML MB field)
Do you mean showing the data dynamically, based on the user selection of related posts/terms? If yes, then I think you'll have to do that your way with JS + custom HTML field.
I ended up accomplishing this using a Custom HTML field & a little PHP and JS.
If anyone else ends up needing direction on this, here are a few links. This is not a drop-in solution for you but hopefully helps get you started.
PHP to handle an incoming AJAX request for term metadata & return JSON:
JS to fetch the taxonomy term metadata and place it into the page:
Add Custom HTML field with html to support the incoming term metadata (I also give it a custom class):
After selecting a taxonomy it populates the Custom HTML like so: