Hi James,
thank you so much for helping me,
Ya tried your given this code
$fields_list = array();
$fields_posts = get_posts(array(
'posts_per_page' => -1,
'post_type' => 'acf-field',
));
foreach($fields_posts as $fields_post){
$fields_list[$fields_post->post_excerpt] = $fields_post->post_name;
}
print_r($fields_list);
but it’s return the null array.
So checked into database and there is no wp_post available having post_type ‘acf-field’.
So still didn’t find any solution.
Any other suggestion ?
Thanks
Hi @james,
I got this “ACF saves two entries in the database, the field value and another is reference”
But the thing is I am using it for Taxonomy’s term, So I guess your given code won’t work in my case.
Well after using the update_field function in this format
update_field('field_1234567890abc', 'test', 'taxonomy-slug_99');
it’s work for me. Now it’s storing the value and reference into WP_option table and I can access the value by ACF functions.
Noe the only issue is how can I get “field key” for my each column. Please have a look at attached file. The column name is the same as ACF filed.
So I guess I have to put the “field key” as column name instead of “filed name” what you say ?
Thanks.
Hi @james ,
Thanks for reply, actually the issue was the “field name” . I tried ‘field key’ and it’s worked for me yesterday. But I am trying to import the the CSV file (with the help of WP all Import plugin) having lots of ACF’s fields .
Inside the loop of CSV data I am getting ACF field’s name but not it’s key. So for now I manually assigned the field key with if else condition. But this is not a good way I guess.
I also tried to find the “field key” by it’s name by using the get_field_objects() but can’t find any luck.
So can you please suggest me a better solution for this ?
Thanks
Hello @tarheeldev and John Huebner,
I also want to import the custom fields attached to each term using ACF.
Can you help me , with you custom code ?
I did the my own code but it’s not working.
Actually update_field() function seems not working for taxonomie’s term.
I have used in this way update_field($key,$value,$term->taxonomy.’_’.$term->term_id);
But still it’s not working.
Please help me.
Thanks.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.