I have this problem a lot for some reason and what I just did to fix it was export my field group, then edit the JSON and change the field keys slightly. For example if the image field’s key is “field_6034ed0dca8ea” then I would change a few of the characters (hex chars only). Then I deleted the group and imported the edited one, and the value started returning correctly.
Forgot an important detail. When importing/exporting, if the image field is set to return an array it changes to return an ID. And if the image field is set to return an ID it changes to return an array. This literally just happened to me 30 seconds ago (latest version).
Thanks for your work on this Marc! I’ll give it a try when I need to clean up some field data.
Figured I’d add something to help people out who want to add a row to a flexible content field that’s inside of another flexible content field.
acf.addAction( 'append', function( $el ) {
if ( $( $el ).hasClass( 'layout' ) && $( $el ).is( '[data-layout="level1_layout_name_here"]' ) ) {
var nestedFlexField = acf.getField( $( '.acf-field[data-name="NESTED_FLEX_FIELD_NAME"]', $el ) );
nestedFlexField.add( {
layout: 'level2_layout_name_here'
} );
}
} );
This works for me:
$( 'body' ).on( 'click', '.acf-fc-layout-controls .acf-icon.-minus', function( e ) {
$( this ).click();
} );
Yep, I didn’t mean to take away from the original intent of the feature request. The two big things are definitely not having to access the fields via array, and then the styling. For now I’m stuck using the ACF Columns plugin, which is a great “hack”, but something native to ACF would make so much more sense.
Hopefully ACF will consider adding this feature, but in the meantime this is what I’m using. Just include this CSS in your admin area and add the no-style class to your Group field.
.acf-field-group.no-style {
padding: 0 !important;
}
.acf-field-group.no-style > .acf-label {
display: none !important; /* If you want the Group's label to show, remove this style */
}
.acf-field-group.no-style > .acf-input > .acf-fields.-border {
border: 0 !important;
}
For people reading this since the new JavaScript API was released, here’s the new method for adding a row to a flexible content field:
var field = acf.getField( 'field_5f4f704c24dcf' );
field.add( { layout: 'layout_name' } );
Thanks John, I sent it.
@prowebassist As far as I know you need to resize the SVG so that the viewbox meets the required dimensions. I’ve been doing that lately and haven’t run into any more issues.
I’ve already gone back and search through all the old posts. Elliot has previously said this will be included in a future release. Can we at least get an update on it? Having this plugin create loads of unnecessary field data seems like it would be higher priority.
+1
All I need is a tool to delete orphaned ACF meta data. When you’re creating a site you frequently rename fields that have data already. It would be nice to just have a button that removes ACF meta data that’s no longer part of a field group.
If it’s possible to add $post_id to render_field, why doesn’t ACF just do it? It might not be used all the time, but having access to the post ID is always a good idea.
No support available for this topic? It’s been over 2 weeks…
Nevermind, I figured it out. The problem was that the plugin’s init function was being run earlier than the init function that registered the taxonomies. Giving my plugin’s init action a later priority got everything working correctly.
@hube2 So it must be the SVG plugin (Safe SVG in my case) that extends getimagesize() and other functions so they can read the viewBox attribute of SVG images. That’s good to know, thanks!
It turns out it’s the viewBox parameter that’s being used to calculate the SVG’s width and height. That’s incorrect as the viewBox simply defines the base rectangle and ratio. Only when an SVG has explicit width and height parameters should it be treated as a static size.
@kiwicreative Thanks for the response. My SVG actually doesn’t have any width or height attributes, just the standard viewBox coordinates. I manually clean up every SVG I use and never include set widths or heights. Now that you mention it though, I’m wondering if it’s using the viewBox coordinates to check the dimensions? I guess that would be up to the SVG plugin? I’ll need to do some poking around…
I think you misunderstood the second part. When you put HTML into the Field Label box, this HTML gets rendered in the field listing of the Field Group. For example, if for the Field Label I put:
<span style="display: block; font-size: 26px; font-weight: bold; line-height: 1.3em; color: #ccc; padding-bottom: 20px; border-bottom: 1px solid #333;">My Custom Header</span>
Then in the Field Group, it will display like this:

What I’m saying is that it should strip all HTML and CSS only in the field listing for the field group. Obviously on whichever page or post this field group is assigned to the HTML would render normally.
Why does this field show drafts by default? Is there a reason? This should definitely be an option in the UI and not require any hooks.
Thank you for this!!! I was racking my brain trying to figure out why my fields were not importing across the multisite, and it turns out they did import, just weren’t showing in Custom Fields. I completely agree with you that there should be some indication in Custom Fields that there are active field groups.
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.