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.
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.
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.
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/
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.
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[tab1][value1]
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);
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.
I will try to re-create everything.
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.
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
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!
© 2022 Advanced Custom Fields.