Hello,
I’m trying to use acf_form()
to load a form inside a dashboard widget. I’ve got the acf_form_head()
loaded via admin_head
on just the Dashboard page and the fields appear fine but in my JavaScript console it says that acf is not defined
which is preventing my selects from dynamically pulling data.
This happens when I’m using the Post Object dynamic select. The solution ended up being found in a topic from 16′
https://support.advancedcustomfields.com/forums/topic/using-acf_form-in-admin/#post-38999
add_action('admin_enqueue_scripts', function() {
global $pagenow;
if ( 'index.php' != $pagenow ) {
return;
}
wp_enqueue_script('acf-input');
} );
Maybe a topic on this would be helpful to others in the future trying to do a similar feature.