I did actually manage to get this working, for displaying the display_name at least. The final code I used was:
<span class="staff-note-label">Note Added By:</span>
<?php
$user = get_sub_field("staff_member");
if( $user ): ?>
<span class="staff-note-name"><a href="<?php echo $user['user_url']; ?>"><?php echo $user['display_name']; ?></a></span>
<?php endif; ?>
I’m unable to get the url to the User’s profile though. The url is showing as the current post url. I’m sure that user_url is the right meta and I noticed there’s code for the user_url in the multiple selected users example at:
https://www.advancedcustomfields.com/resources/user/
But I tried it with a multi select user field as well and used the second example code and the link is still for the current post and not the user profile url. How can I get the link for the user’s profile in this context?
Thanks.
Thanks @daniel-buth That’s how I had the block setup originally.
In ACF, it’s set to Post Object already.
I have created a gist of the amended code:
Gist
Now what I am getting is ALL the posts are displaying the content of the page they are being shown on. And not bringing in any of the selected items from the ACF Relationship field block.

No, a tool does not exist to do this. If you move fields around (in or out of repeaters or group fields) or you rename them then the values already save will not be accessible.
Altering the database to reflect any changes would be completely dependent on the exact changes made and could likely cause other things to break.
There are paths for making these changes but there is nothing simple, and again, it would be dependent on the changes made.
Let’s say for example that I want to do something as simple as change a field name, instead of changing the field name I would leave the old field alone and add a new field with the new name. Then I would add several filters.
Please not that this us just an example and it may not work for your specific field, it is just a starting place.
// use the field key of the old field
add_filter('acf/prepare_field/key=field_XXXXX', 'hide_old_field');
function hide_old_field($field) {
// this prevents displaying the field so the value can no longer be edited
// but any existing value will be preserved
return false;
}
// load the old value when getting the new field
add_filter(acf/load_value/name=your-new-field-name', 'load_old_value_in_new_field', 1, 3);
function load_old_value_in_new_field($value, $post_id, $field) {
if ($value === NULL) {
// a value was never saved for this field
// get the value from the old field
$value = get_field('old_field_name', $post_id);
}
return $value;
}
I’m trying to apply this to an option page, but cannot get it to work.
$labels = array();
$field = get_field_object( 'sidebar_home', 'option' );
$values = get_field( 'sidebar_home', 'option' );
foreach ($values as $value) {
$labels[] = $field['choices'][ $value ];
}
//And this is how I'm displaying it
<?php echo implode(', ', $labels); ?>
I’m getting an “Illegal offset type” error.
My select field is set to multiple choices and a return format of “Both (Array)”.
Any clues of why I’m getting that error?
Thanks!
@gila-monster Thanks for you advice.
My fields are displaying in the back end under my product variations and the data is saving correctly but I cannot work out how to show the fields on the front end of my website?
Do you display them in the same way as you normally would ACF fields? e.g.
<?php the_field(‘text’); ?>
Incase it’s useful to anyone looking. I troubleshooted this issue down to a specific behavior in my project.
The bug
In a plugin I was authoring, I called get_field on repeater too early which caused a whole host of problems with ACF including the repeater field returning only it’s count as a string, and data seemingly not saving to the repeater when pressing the Update button.
(in reality, ACF was saving the edits properly to the database but displaying an empty repeater in the post editor as a result of this error).
The solution was to hook my ACF-dependent logic to the acf/init action instead found here:
https://www.advancedcustomfields.com/resources/acf-init/
Without hooking into acf/init, you would expect PHP to throw a fatal error and say get_field() is not a function in this case, but that didn’t happen.
I’m thinking get_field() was being called in some intermediary matter– after the get_field() function was registered, but before other functions in its call stack were available– resulting in a half-baked instantiation for that particular repeater’s data.
¯\_(ツ)_/¯.
Thanks for replying John 🙂
I am actually using that solution from Elliot:
acf.doAction('append', $('#huub_tasks_form'));
However, prior to the update I was using:
acf.do_action('append', $('#huub_tasks_form'));
Which is the old way, right?
The strange thing is, all fields work perfectly. I even have a relationship field that gets loaded without any problems, and even the AJAX search and infinite scroll work. Select2 fields also work. Tabs work. Conditional logic works. The lot.
But it’s only when submitting the form that if, for instance, I have not selected an item from the relationship field, the AJAX validation does not work and I am taken to the typical WordPress error screen displaying the validation message.
I have acf_form_head() included in the header but perhaps I need to include it again in the PHP file that contains the AJAX action?
Hi John,
Thanks. I appreciate the basic info, though perhaps I have understated my experience level. I’m more an intermediate-level coder with respect to both WordPress and PHP; I understand the basics of both, but still have to look up a lot of things like filters and actions or PHP functions and precise parameters as I more often than not need a refresher.
So, I definitely do know which template I’m using for the page in question already. I can tell in the page editor, and it’s a template I wrote the PHP file for myself. Other fields and custom fields are working fine, including not only the built-in WYSIWYG editor but 3 other ACF fields. Only the ACF WYSIWYG field is not displaying anything.
I’ve also tried echoing the problematic ACF field both inside and out of the loop, to no avail.
Maybe a code snippet would be helpful. Here’s my template PHP file’s contents (page-feature.php). The $subtext variable (get_field(“additional_subtext”)) is the problematic field; the other three fields all work fine ($heading and $button_text are ACF Text fields, $btnLink is an ACF Link field).
<?php
/**
* Elegant Simplicity Theme: Feature Page Template
*
* This template is...
*
* Template Name: Feature Page
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package Elegant_Simplicity
* @since 5.2.0
*/
get_header();
$heading = get_field("heading");
$btnText = get_field("button_text");
$btnLink = get_field("featured_link");
$subtext = get_field("additional_subtext");
?>
<h1 class="cover-heading"><?php echo $heading; ?></h1>
<?php while (have_posts())
{
the_post();
get_template_part('template-parts/content-featurepost', 'page');
}
?> <p class="lead"><a href="<?php echo $btnLink; ?>" class="btn btn-lg btn-outline-secondary"><?php echo $btnText; ?></a></p>
<?php if (!isset($subtext) || '' === trim($subtext))
{
echo $subtext;
}
get_footer();
?>
Thanks!

Hmmm…
anything that can be a single object is a post. It’s not how I’m going to relate them that’s important but what they represent. A taxonomy is uses when multiple descriptors can be applied to an object.
In my case, the primary case is that some existing Posts should relate to an Event. Eg. Conference reports from “CES 2018”, from “Cannes Lions 2019”. I guess multiple posts from a single given event could constitute the “multiple descriptos applied to an object”.
But there will also be some cases where the thing that relates to an Event will not be Posts at all but, rather, some indication that I had a *function* at the event – eg. speaker/host/panelist. That’s something I’d like to express on the Event page but also collate eg. “all events I hosted”. Regardless, these don’t seem to be expressions that arise out of a relation to any Post content.
So that seems like a bit of both Taxonomy use-case and Post use-case.
I would probably also create a “user” post type of some kind, maybe call it “speaker” that may or may not be related to actual site users
I know where you’re coming from.
My forethought on this one is deliberate, even if it may complicate things.
I actually already have a Taxonomy called “People” with a couple of thousand terms, which would be suitable. But, for the forseeable future, the only person I would want to relate to Event roles like host/panelist is… me… and I’m a User. In the future, I can theorise extending the same to other members/Users of the site. Those people would also have Post content and I would be one of the Users alongside them, so it seems natural to think about linking to a User.
Stepping back to think aloud…
Let me see…
If “Events” were a Taxonomy, perhaps I could just not sweat the missing bidirectionality caused by the absence of a two-way Term-to-Term relationship. Thinking about the contexts in which information would be displayed, where things can be saved without needing to see it on both sides, and what’s really required…
Event object / single term page:
– Seve/relate the majority of fields here…
– inc User event role (would not naturally/conceivably be set on the User profile anyway)
– inc Organisation (could arguably want to set related events on the Organisation page as well as Event edit, but is it really essential?)
– inc Topics (set the Topic on the Event edit, not the Event on the Topic edit).
Post object / single post page:
– Tag the post with the relevant Event, from Post Edit. I shouldn’t fret that I couldn’t do it the other way around.
After all, in the case of native WordPress relationships, I shouldn’t justifiably expect to use a Term page to set and unset Posts, should I?
So maybe I should just use Events as taxonomy, then relax about setting some related fields in the right contextual place and not expect to see the related pieces in their mutual backend locations?
So, sometimes I would be displaying terms, sometimes Posts, depending on the context of the theme file.
Hmm…

Hi WDCreativ,
I’m not sure about what you need, you’re talking about displaying a field group to logged in user and about showing post content which was assigned to the user. Can you tell me more ?
What do you want to display : CPT Content ? Field Group ? …
Where : In backend ? Frontend ? On user profile ? On CPT ? …
With wich rules : Display it if you assign user to the CPT ? When user select the CPT ID with the select field ? …

Are you returning the value, label or an array for the checkbox field? This information would be needed to write code.
The example here on showing displaying the value and label is old but it has the basics https://www.advancedcustomfields.com/contact/
What you need to do is get the field object. Then instead of looping over the values that are checked you loop over all of the values in $field['choices'] and you display them all and you check to see if that value has been set in the field value, if it is you show one thing and if it’s not you show another.
I hate to revive this, but it’s one of the more relevant threads I could find.
I just created a CPT with some ACF custom fields in it to replace an old plugin that we’re ditching. All works well, but I cannot get the sorting to appear correctly.
My data is stored in ACF date-picker “format” for new entries I assume, but the old entries did come in via a CSV import of heavily-massaged data (old plugin wanted $90 for an “export” feature, so F-that). Can I assume the dates are stored correctly if they are displaying correctly when pulling them via get_field()? Or no? This is ACF5, just noting that as there was mention of the format changing between 4 and 5.
I have created what I think will pull posts with the custom field values for ‘bustype’ – when the value is then entered into the shortcode as a parameter. This code was working fine before I tried to add the custom field.
I have tried this, however, and nothing is displaying as posts.
From looking at what I have written below, and knowing that the Advanced Custom Field is a select field with set values ‘buyers’, ‘service’, and ‘otherbus’ – is there any reason what I have below would not check against the value in metavalue=”” entered within the shortcode?
Shortcode I used, to display posts with the value ‘buyer’:
[list-posts type="company_directory" posts_per_page="40" posts="40" metavalue="buyer"]
Below is the code I have added to functions.php to try and use the custom field.
// start code to add shortcode
add_shortcode( 'list-posts', 'rmcc_post_listing_parameters_shortcode' );
function rmcc_post_listing_parameters_shortcode( $atts ) {
ob_start();
// define attributes and their defaults
extract( shortcode_atts( array (
'type' => 'post',
'order' => 'ASC',
'orderby' => 'menu_order',
'posts' => -1,
'color' => '',
'class' => 'post',
'fabric' => '',
'category' => '',
'metavalue' => '',
'fieldname' => 'bustype',
), $atts ) );
// define query parameters based on attributes
$options = array(
'post_type' => $type,
'order' => $order,
'orderby' => $orderby,
'posts_per_page' => $posts,
'color' => $color,
'class' => $class,
'fabric' => $fabric,
'category_name' => $category,
'meta_key' => $fieldname,
'meta_value' => $metavalue,
);
$query = new WP_Query( $options );
// run the loop based on the query
if ( $query->have_posts() ) { ?>
<?php $i = 0; ?>
<div class="bus-directory et_pb_row et_pb_row_1 et_pb_gutters2 et_pb_row_4col">
<?php while ( $query->have_posts() ) : $query->the_post(); ?>
// Content to return goes here
<?php $i++; endwhile; ?>
<?php
$myvariable = ob_get_clean();
return $myvariable;
}
}
Thanks for your help.

Are you using gooberbug? There are some issues with field groups appearing when they should with the block editor.
If not, check your location rules for the field group. I’m not seeing issues when fields not displaying when registered in PHP. What are your location rules for these groups.
Also having the second issue, FC fields not displaying at all. Again only on some of our sites, even though the code base’s are basically the same.
Found a solution at https://support.advancedcustomfields.com/forums/topic/google-map-not-displaying-on-wp-backend/
Activate this api in the library:
Geocoding, Geolocation, Maps javascript, and Places api.

I’m not a developer of ACF, just another user.
I’m not exactly sure what you mean the second part, but ACF is a plugin that requires the modification of templates and the use of PHP on the front of the site. It is an admin tool for developers that aims to reduce the work involved in creating the admin for custom fields and simplifies the getting and displaying of those fields.
The code I posted would go in your template file where you want to show the field values on the front of the site.

TLDR; You can’t trigger ACF to rebuild the field key references. You need to redo the migration so that the correct field key references are also moved.
Long answer
ACF doesn’t rebuild the metadata.
Internally, ACF uses the field key. The field name is changeable and can be duplicated. The field name is only for our convenience.
When displaying the fields for editing, ACF has the field key because it uses the field keys to display the fields for each post. It looks at the field key, gets the field object for that key, gets the field name from the field object and then uses get_post_meta() on that field name in combination with the current post ID to get the value of that field. This is why it can successfully get the values in the admin. It has both the post ID and the field key to work with.
With more complex fields, like repeater sub fields ACF is recursing into the repeater and using additional information to generate the meta names that it uses to get the values.
When you save a post in the admin the value/field you submit uses the field key, not the field name. Again, ACF already has the post ID and the field key. For each field submitted acf calls update_field($field_key, ). This causes ACF to get the field object and extract the name and then update both meta values.
This has been asked here before and as far as I’m aware, no one has successfully created a way to rebuild all of the field key references for every post. To get ACF to add the correct field key reference you need to supply it with the field key, the post ID and then value for the field. If you are dealing with repeaters or other fields that have sub field you also need to provide the rows with “field key => value” pairs. And since the field key references either do not exist or are incorrect, you can’t use ACF to get the values in order to update them correctly. There is a viscous circle here which could potentially be overcome as long as you don’t have any repeaters, clones, flex fields or any other type of field that has sub fields. Thne you can loop over these groups and get the field in them, get each field name, get the value and then use ACF to update the field.
$groups = acf_get_field_groups(array('post_id' => $post_id));
foreach ($groups as $group) {
$fields = acf_get_fields($group_key);
foreach ($fields as $field) {
$value = get_post_meta($post_id, $field['name'], true);
update_field($field['key'], $value, $post_id);
}
}
But this falls apart as soon as you start dealing with sub fields. This would require building a recursive function on each field checking for field types that include sub fields. Each type of field would need to be handled independently. As to examples I will use a repeater vs a flex field. When you use get_post_meta() as above on a repeater field it returns a number that represents the number of rows in the repeater. When you get the value of a flex field it will return an array where each element of the array is the layout name used for that row. Based on this it would also need to check each sub field for it’s type and recurse again based on this, finally returning all of the values of all sub fields so that it can be correctly updated.
And in the end, with a site with 1000+ posts, all this work would likely time out or exceed the max execution time do the the number of queries that WP would need to perform.
It would need to be an svg image, and is meant to be possible according to https://www.advancedcustomfields.com/resources/acf_register_block/ though I and others have not been able to get this to work, see https://support.advancedcustomfields.com/forums/topic/gutenberg-block-custom-svg-icon-not-displaying/
Hi,
I’m having an issue with displaying multiple google maps that are not in an accordion.
I created a repeater for different locations, for each row I have the name of the location and the google map field. I tried to output that in my template using the code provided by ACF, but the maps appear with no pin/marker, and are not in the right spot on the map.
If I have only one row in my repeater, it works fine. So I’m assuming that it’s a problem between the js and my html elements.
Each map div has the class .acf-map, but I see in the js that it uses .each to make sure it works for multiple maps.
Is there something wrong with my code? (note that I don’t want multiple markers in one map, but multiple maps with each one marker).
<?php if(have_rows('contact_locations_repeater')): ?>
<?php while(have_rows('contact_locations_repeater')): the_row(); ?>
<div class="location">
<div class="map">
<!-- GOOGLE MAP-->
<?php
$location = get_sub_field('google_map');
if( !empty($location) ):
?>
<div class="acf-map">
<div class="marker" data-lat="<?php echo $location['lat']; ?>" data-lng="<?php echo $location['lng']; ?>"></div>
</div>
<?php endif; ?>
<!-- END GOOGLE MAP-->
</div>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDsVBtPm96bvZOTLPy6yBxGBxHE9TU8mtw"></script>
<script type="text/javascript">
(function($) {
/*
* new_map
*
* This function will render a Google Map onto the selected jQuery element
*
* @type function
* @date 8/11/2013
* @since 4.3.0
*
* @param $el (jQuery element)
* @return n/a
*/
function new_map( $el ) {
// var
var $markers = $el.find('.marker');
// vars
var args = {
zoom : 18,
center : new google.maps.LatLng(0, 0),
mapTypeId : google.maps.MapTypeId.ROADMAP
};
// create map
var map = new google.maps.Map( $el[0], args);
// add a markers reference
map.markers = [];
// add markers
$markers.each(function(){
add_marker( $(this), map );
});
// center map
center_map( map );
// return
return map;
}
/*
* add_marker
*
* This function will add a marker to the selected Google Map
*
* @type function
* @date 8/11/2013
* @since 4.3.0
*
* @param $marker (jQuery element)
* @param map (Google Map object)
* @return n/a
*/
function add_marker( $marker, map ) {
// var
var latlng = new google.maps.LatLng( $marker.attr('data-lat'), $marker.attr('data-lng') );
// create marker
var marker = new google.maps.Marker({
position : latlng,
map : map,
title: 'DSRU',
icon: '<?php the_field('map_pin');?>'
});
// add to array
map.markers.push( marker );
// if marker contains HTML, add it to an infoWindow
if( $marker.html() )
{
// create info window
var infowindow = new google.maps.InfoWindow({
content : $marker.html()
});
// show info window when marker is clicked
google.maps.event.addListener(marker, 'click', function() {
infowindow.open( map, marker );
});
}
}
/*
* center_map
*
* This function will center the map, showing all markers attached to this map
*
* @type function
* @date 8/11/2013
* @since 4.3.0
*
* @param map (Google Map object)
* @return n/a
*/
function center_map( map ) {
// vars
var bounds = new google.maps.LatLngBounds();
// loop through all markers and create bounds
$.each( map.markers, function( i, marker ){
var latlng = new google.maps.LatLng( marker.position.lat(), marker.position.lng() );
bounds.extend( latlng );
});
// only 1 marker?
if( map.markers.length == 1 )
{
// set center of map
map.setCenter( bounds.getCenter() );
map.setZoom( 16 );
}
else
{
// fit to bounds
map.fitBounds( bounds );
}
}
/*
* document ready
*
* This function will render each map when the document is ready (page has loaded)
*
* @type function
* @date 8/11/2013
* @since 5.0.0
*
* @param n/a
* @return n/a
*/
// global var
var map = null;
$(document).ready(function(){
$('.acf-map').each(function(){
// create map
map = new_map( $(this) );
});
});
})(jQuery);
</script>
<div class="text_block">
<h3><?php the_sub_field('contact_location_name');?></h3>
<p><?php the_sub_field('contact_location_address');?></p>
</div>
</div>
<?php endwhile;?>
<?php endif;?>

@shahbazi It may be a language barrier thing, but your question is kind of difficult to understand what you are asking. When you say you want to show part of the image on the vendor page so that the seller can upload the image there. That doesn’t make any sense to me. What is part of the image? And how would displaying an image allow a user to upload an image?
Are you asking if you can use ACF to place an image upload button on the front end? I personally have never seen that done before, but can’t say for sure whether it’s possible or not. From what I understand, ACF itself won’t display an image upload field on the front end, only on a post edit screen, from which you can then display the image in your page template using something like:
<?php
// get image field return value from post edit screen
$image = get_field('vendor_image');
?>
<!-- If return type is array -->
<img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" />
<!-- If return type is URL -->
<img src="<?php echo $image; ?>" alt="hardcoded alt text description" />
If you’re wanting to give users the ability to upload images on the front end, you will most likely need to code this manually, using <input type=”file”> form control and then handling the storing/access of the image with php or js. Or perhaps you can find another plugin to do this for you, but I’ve never heard of ACF being used for something like that. Then again, I could be totally misunderstanding what you are asking.
Hi
I’m using elementor and Ocean WP theme.
I have created a new custom field called ‘category image’ and applied it to a new taxonomy I made using CPT UI called ‘Success Story Categories’. The intention being that when I click on a category, I want it to display the archive page for that category, plus a category image.
It works fine in Elementor edit mode and the dynamic field changes depending on which category is shown. But when I look at it from the users front end, the image is not displaying. It will only show a fallback image.
Is this the same issue as Jennifer and Arthur do you think? Or should I start a new thread?
Hi @bluerhinomiami, yes I did.
I used the following code in my plugin .php file (or it can go in the functions.php file if you’re not creating a plugin):
add_action('wp_ajax_data_fetch', 'data_fetch'); // logged in users
add_action('wp_ajax_nopriv_data_fetch', 'data_fetch'); // other users
function data_fetch(){
$post_id = filter_input( INPUT_POST, 'post_id' ); // post id passed from select value via ajax
$rows = array(); // setup empty array
$rows = get_field('new_colour', $post_id); // repeater field
if($rows)
{
foreach($rows as $row) // foreach for each repeater row
{
$array[] = '<li data-id="' . esc_attr( $row['unique_id'] ) . '"><input type="text" name="" value="' . $row['colour_name'] . '"><a class="remove-checkbox dashicons dashicons-trash"></a></li>';
}
}
wp_send_json($array); //Use WP send json function - send data back to the page I'm displaying the div on
}
The $row['unique_id'] section for the data-id is making use of the Unique ID addon for ACF.
The following js function is what I’m calling when the select box changes:
function reload_colours($el) {
$el.closest('.acf-row').find('.all-colours span').empty();
var post_id = $el.closest('.acf-row').find('select').val(); // value of select dropdown = page id where repeater is located
var data = {
action: 'data_fetch',
'post_id': post_id
}
var $customList = $el.closest('.acf-row').find('#modal:eq(0) .acf-checkbox-list'); // element I'm displaying data in (i have multiple divs I want to populate with values)
var dataid = $el.closest('.acf-row').data('id');
$.post(ajaxurl, data).done(function (result) {
$customList.find('li').not(':first').remove(); // emptying the div of any previous data
$customList.append(result); // appending results to div
$el.closest('.acf-row').find('#modal:eq(0) .acf-checkbox-list input[type="text"]').attr({ 'readonly': true, 'name': 'acf[field_5b55d0491f741][' + dataid + '][field_5bbb6a62912a9][]'});
});
}
Basically what’s happening is I’m populating the .acf-checkbox-list div, that is being generated by ACF, with text boxes that contain the values from selected custom post. This is essentially replicating what happens when you click the button to add a new custom checkbox value, and then when you click save it appears that ACF does the work for you in saving the data to the post.
Hopefully that points you in the right direction.
If you need my acf json file just let me know.
EDIT: Forgot to mention that the field keys being used in my ajax call will obviously be different to yours. I just copied the field keys being used by the default “add a custom value” button if I remember correctly.
I am using this code <?php posts_nav_link(); ?> to get the pagination but not working, I am trying to solve this from so many days but no result please help on this.
And I am displaying upcoming events in a seperate page using custom template file.
And I have taken the code from this resource – https://www.advancedcustomfields.com/resources/date-time-picker/
How to get working pagination for this? Please help.
Just in case anyone stumbles upon this and is trying to do the same I’ve managed to pull in the repeater values using the following (all of which is located in the same file on my setup):
add_action('wp_ajax_data_fetch', 'data_fetch'); // logged in users
add_action('wp_ajax_nopriv_data_fetch', 'data_fetch'); // other users
function data_fetch(){
$post_id = filter_input( INPUT_POST, 'post_id' ); // post id passed from select value via ajax
$array = array(); // setup empty array
$rows = get_field('new_colour', $post_id); // repeater field
if($rows)
{
foreach($rows as $row) // foreach for each repeater row
{
$array[] = '<li data-id="' . esc_attr( $row['unique_id'] ) . '"><label><input type="checkbox" value="' . get_the_title($post_id) . " - " . $row['colour_name'] . '">' . $row['colour_name'] . '</label></li>'; // stuff I want to display on the div I'm appending the repeater values to
}
}
wp_send_json($array); //Use WP send json function - send data back to the page I'm displaying the div on
}
$field.change(function () { // $field = select dropdown
var post_id = $(this).val(); // value of select dropdown = page id where repeater is located
var data = {
action : 'data_fetch',
'post_id' : post_id
}
var $customList = $(this).closest('.acf-row').find('#modal .checkbox-list-custom'); // element I'm displaying data in (i have multiple divs I want to populate with values)
$.post( ajaxurl, data ).done(function(result) {
$customList.empty(); // emptying the div of any previous data
$customList.append(result); // appending results to div
});
$modal.removeClass('visible'); // hide other open divs for additional select relationship field drop downs
$(this).closest('.acf-row').find('#modal:eq(0)').addClass('visible'); // making relevant div visible after the above has completed
});
I’ve not included anything to save the metadata to the post yet, but that shouldn’t be too difficult (famous last words right there).
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.