Support › MB Relationships › Getting all data from relationshipResolved
I have a relationship between two CPTs. Let's say 'hotels' (wp_hotels) and 'units' (wp_units).
On the hotel page, I'd like to show all that information, but also information pulled from the units table and not just the title.
For simplicity, I will use these fields:
When I do
$connected = new WP_Query( [
'relationship' => [
'id' => 'units_to_hotels',
'from' => get_the_ID(),
'nopaging' => true,
I do a printR on $connected, I see the correct units, but not the custom fields.
On my 'hotel' page, I would like to show:
Units In Hotel:
(type) - (date_available)
.... essentially, how do I show (type) and (date_available) on the hotel page? Thank you!
After doing a bunch of reading here, I think this may have the solution I need.
I guess the answer is to just use a helper. I thought I tried the php version of it and it didn’t work but I’ll try again and mess around. Maybe I had a typo
Yea you can close this. The helper worked, I must have just been typing something wrong when I first tried.