I also got error on HHVM.
ACF pro cannot loop correctly on HHVM.
And its load is really heavy.
Switched to php-fpm7 then it was resolved.
I got same error.
When you use normal ACF (not Pro), the following link will help you.
I am using Pro version, I have edited below.
ABSPATH . /wp-content/plugins/advanced-custom-fields-pro/api/api-template.php: L1026
at acf_form_head()
// load acf scripts
//acf_enqueue_scripts();
}
commented out act_enqueue_scripts();
I got same error.
The reason is that Javascript is loaded before acf_form() generating ACF elements.
Bad case.
<?php
acf_form_head(); // <-- bad!
get_header();
?>
<?php acf_form(...); ?>
Correct.
<?php
get_header();
acf_form_head(); // <--- here!
?>
<?php acf_form(...); ?>
I changed the ACF type from “Post Object” to “Integer”.
Then I cannot select “Post Object” from select box at admin panel, but my Program can control the value with relation.
@hube2 Thank you for your reply.
The project was ended, I will try your idea at next time.
Thank you!
I think I have to use update_field();
function update_acf_manually() {
var_dump('update_acf_manually');
$args = array(
'orderby' => array('ID' => 'ASC'),
'post_type' => 'member',
'posts_per_page' => '-1',
);
foreach (get_posts($args) as $post) {
$pm = get_post_meta($post->ID, 'join_date', true);
$Y = substr($pm, 0, 4);
$m = substr($pm, 4, 2);
$d = substr($pm, 6, 2);
if ($Y && $m && $d) {
var_dump("$Y-$m-$d");
$pm = "$Y-$m-$d";
update_field('join_date', $pm, $post->ID);
}
}
}
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.