You need to loop for the results and call get_fields() again. So after your code add smt like:
foreach( $locations as $l ) {
//grab post id
$pid = $l['ACF_Relationship_Field'][0]->ID;
// grab fields
$fields = get_fields($pid);
// add them back. As ACF_Relationship_Field is an object I will add it next
// to it, but you can do whatever you prefer
$l['ACF_Relationship_Field'][] = $fields;
}
Related Posts:
- How to import CSV into Custom Post Type custom fields?
- update_post_meta and update_field ony working when saving the post
- Advanced Custom Fields select field : How to echo the label, not the value? [closed]
- ACF: get_field() returning false [closed]
- Adding custom fields to the header.php
- How to get_terms() only of terms matching an ACF meta value?
- WP REST API: Order posts by meta value (acf)?
- Get the label from ACF checkbox [closed]
- Advanced custom field – gallery – display one random image
- Check for the existence of custom field
- Query pages for use of a flexible content layout
- ACF repeater field with meta_query
- sort by date in Advanced Custom Field
- How to customize a divs background dynamically using Advanced Custom Fields Plugin?
- disable (read only) a field if within a custom post type name
- ACF if / else checkbox [closed]
- ACF Plugin – Random Gallery Image with wp_get_attachment_image()
- Sorting custom admin column by value
- WP Rest endpoint with custom post type and ACF Fields
- ACF Custom validation message not showing up
- ACF Advanced Custom Fields | Help me grab the fields on my WooCommerce homepage [closed]
- Update post meta value as date difference between two fields
- My get_terms not working for custom fields
- How to share repeated fields across multiple pages?
- Remove headings option from Wysiwyg editor from ACF in a certain custom post type
- How to break a date from ACF?
- get all posts in custom post type by ACF field value
- Remove YoastSEO meta description from output/source [closed]
- Advanced Custom Fields changes get stuck in cache
- WordPress Date with ACF
- Get posts with multiple meta values
- html element to separate php variable strings – ACF datepicker
- Get image data from advanced custom field [closed]
- Check for image with same filename but different extension
- Can’t get “has_sub_field()” to work in a conditional [closed]
- Advanced Custom Fields if else issue
- If/Else Statement for Advanced Custom Fields
- How to get both image attachment ID and url
- Search and replace not working for ACF Images
- how make file upload field through custom field
- How Do I Use a ACF Custom Field To Add A Slider ID?
- Advanced Custom Fields oembed only outputs YouTube URL
- Hidden field in acf
- Importing ACF code in other page templates
- ACF Content with WPML not saving [closed]
- How to show Advanced Custom Fields data above share links, pagination, etc
- How do I ensure the social icons appear on all pages? [closed]
- Order get_terms by multiple meta_values
- Strip comma from last element in concatenated JSON string
- How can you query posts by advance custom field when the value is a serialized array? [closed]
- Query by radio button ACF
- Sorting the portfolio by an ACF? [closed]
- How to change the background color of my header dynamically based on a Custom Posts types color value?
- Advanced Custom Fields Plugin: how to use a checkbox to allow a post to show up in desired “zone”?
- TinyMCE’s “Clear Formatting” button doesn’t remove lists and headings
- ACF: Grid based on field value
- Can I use WP blocks in a template?
- Set post publish date by custom field
- Use Acf Repeater data as options for a different acf custom select field
- ACF get group fields from current post taxonomy
- Is there any way to bulk search-replace URLs that exist within ACF’s “Link” field type (serialized)?
- Transitioning Laravel App into WordPress (Portfolio Website)
- get the title of a relationship field
- ACF – Adding PHP into Slick Slider Breaks the Slider
- Creating permissions rules with ACF repeater field
- Advanced Custom Fields frontend form submission
- Display of Custom Fields based on conditional if/and according to category/tag choice
- Comparing two dates (ACF and current time)
- Advanced Custom Fields oEmbed video width and height
- Display ACF field(s) from widget in FE
- ACF: Updating gallery field doesn’t work in backend
- Advanced Custom Fields, DatePicker – Check if Set
- How to access advance custom fields with post type in a for each loop
- How to pass get images in homepage also in portfolio page?
- ACF order relationship by date
- How to create an ACF shortcode with Repeater Field in WordPress functions.php?
- Generate custom sized images from certain images in media library
- Acf Pro repeater field returns null when call inside foreach
- Relationship field search not retriving posts in admin
- How to use an ACF taxonomy relationship field as part of the URL structure for a custom post type?
- wp_insert_post with advanced custum fields repeater
- Only list category if it has a custom field image
- advanced custom fields plugin last input field in new posts
- Display “Today” Instead of Date for Pubslished Posts
- Separate [Advanced Custom Field] values by commas
- Updating custom fields with data from the database
- Time sort with meta_key using UNIX timestamp failing due to date differences
- Getting “Invalid argument supplied for foreach()” Warning
- How not to strip leading zero in advanced custom fields
- update_field() with repeater fields issue [closed]
- Advanced Custom Fields Image Crop
- Display ACF field only if value is greater than 0
- How to use ACF repeater? [closed]
- How to use WordPress to embed a SoundCloud download link?
- upgrading ACF (advanced custom fields) on an old site [closed]
- Updating post object via ACF breaks front-end
- Generate the post title from ACF fields
- Same ACF Relationship field for multiple Post Options sub-pages?
- Advanced Custom Fields – Issue with Slick Slider in ACF v6 Block
- How can I update an ACF field in a repeater on post save?