I’m experiencing the same problem with the latest version, although without any console errors. Rolling back to 5.6 also solved the issue for my site.
Looking forward to an update.
Thanks for your reply; I got it working like this (using acf/load_field to first check permissions and set a global var):
add_action ( 'admin_footer', 'check_ACF_permissions_button' );
function check_ACF_permissions_button($post) {
if ($GLOBALS['projectManager'] === false) {
?><script type="text/javascript">
jQuery('a[data-event="add-row"]').remove();
jQuery('a[data-event="remove-row"]').remove();
</script><?php
}
}
Well, I thought this would work:
acf/init
…but it fires before the acf/load_field filter runs.
For reference, this thread was very similar but unfortunately no solution was presented:
Disable Update button until all fields have loaded
This is immensely helpful, thank you so much for lending a hand. =)
Perhaps someone can tell me why this code:
$oldValue = get_sub_field('project_current_status');
…is returning the last of all of the ‘project_current_status’ fields (total)!
My understanding is that it should only be returning the field referenced inside of the ‘have_rows’ loop.
Is this not correct? Thank you.
In case anyone ever reads this, solved with:
add_action( 'update_post_meta', 'update_post', 10, 4 );
…and removing the return at the end.