Right @ihorvorotnov I think problem is I’m including ACF in theme folder and trying to load it from there, but that’s too early. So the only proper way to load it from theme folder is if I install it as a ‘wordpress-plugin’.
@ihorvorotnov Well, for some reason this ain’t working to me as you described.
Like muplugins_loaded hook is never fired at all, I place a wrong path inside and no error.
I also tried to ‘update_option(‘dummy’, 123)’, but that ain’t added to database either.
It’s on my localhost and I have a WPMS installed, but can’t see a reason why this wouldn’t work.
Any ideas?
Works: get_post_meta( $post_id, ‘video’, true );
So don’t use get_field, as far I can see only URL is stored in database.
Found it:
$('body').on('click', '[data-event=remove-layout]', function(e) {
return confirm("Delete widget?");
});
I do this with my options, I save them in a transient and flush it each time options are saved. Makes less queries
How about using ‘save_post’ hook to store your repeater in a single meta. You can either store id’s or image urls when saving post, then use this single meta to get and display data
Hi James,
Thanks for your reply, but my question was regarding exporting fields.
When you do:
1. auto populate fields using example you shared
2. you export fields as php, so you can include them somewhere and you don’t have to re-create fields
you also get values exported for a select field you were auto populating.
Hi hume,
thanks for answer, but this was not the problem.
problem was when I used get_field to retrieve values, i got wrong values returned.
it is on my localhost but somehow it works now, not sure what happen.
Looks like this started to happen after I have updated to ACF pro latest version.
– I include ACF inside theme folder
– As far I can see from DB, what I get returned as a value is field from options table ‘options_locations_area’
So looks like the function for getting repeater field values is not loaded fully at this point.
Found a solution, post about it: http://www.bobz.co/display-posts-google-map-radius-latitude-longitude-acf/
Hi there,
I have run into same problem on one of my projects.
Have written a blog post about it, you can check my solution here: http://www.bobz.co/display-posts-google-map-radius-latitude-longitude-acf/
Hope it helps.
Cheers
Well ain’t this a tricky one.
I have found problem, my fields are named: field_myname.
this ‘field_’ prefix I use makes problem while saving data.
I have renamed it to ‘fld_myname’ and now it works.
Can you imagine that.
I would suggest you to always first make:
<pre>
print_r( $field );
</pre>
I personally don’t use these functions, i use standard php foreach loop.
Repeater field, especially when it’s nested returns very complex multidimensional array, so maybe first try to simplify your array.
Or you can maybe try to access it like: field[0][tab1][value1][0]
Oki thanks, I will think of something.
BR
Vlado
Hi E,
Not sure, I googled this, can’t find it now.
Someone post it on a blog.
I was creating some shortcodes for making columns and I had trouble with this autop, this fixed my problem.
BR
V
Hi,
Maybe you can try this solution:
// Change the execution priority of wpautop so that it executes
// after the shotcodes are processed instead of before
remove_filter( 'the_content', 'wpautop' );
add_filter( 'the_content', 'wpautop' , 12);
Hi Elliot,
Yeah, I taught so.
Anyway deleting solved my problem, really strange error, good thing it’s fixed.
Thanks for your time.
BR
Vlado
Hi,
I have manually delete all postmeta created by ACF.
Looks like I have 2 fields with same name under, I had
1. ‘address’ under options page
2. ‘address’ under page with title ‘Contact’
Could this be the issue?
BR
Vlado
Well I don’t know.
I had feeling that it stopped working after I imported data from production server to my localhost (wordpress export/import).
Cannot be to big on my localhost, it should work.
Strange issue.
I will try to re-create everything.
BR
V
Hi,
I have emptied postmeta table entirely and now it works.
Cannot do that on production site 😛
Any advice what might be issue here?
BR
Vlado
Hi E,
Thanks for reply, and happy new year.
– Can you try using ACF as a normal plugin, and removing it from your theme? Does this fix the issue?
V: No. Problem occurs only on certain pages, on 4 from 20 pages I cannot save fields.
– Does the issue occur on your local version? I’m a bit confused about your statement regarding the local / live.
V: Yeah, on my localhost is clean WP installation and it happens there to.
local: localhost, live: production.
– If you create a new field for the ‘page’ with a unique field_name, does it save correctly?
V: I did that to, but not working either.
– What do you mean by ‘and post meta is included with PHP.’
V: Plugin is included in theme, and what I do is I export field groups in PHP and then include them in functions.php.
That way I can create all field groups on localhost and I don’t have to do everything again on production.
Strange thing is that this only happens on certain pages, on some of them it’s working fine. I don’t know what to think.
Will try to delete all post meta trough phpmyadmin.
BR
Vlado
Hi,
I have written little tutorial on how to achieve this, so I might just share it here: jQuery Auto Populate
Hi E,
Thanks for reply.
I have found a solution like this,
– when I enqueue and localize script i lookup for a values in database and save them in localized variables.
Then after I load all values in select menu i just set option as selected.
Important thing is that it works
BR
V
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.