Support

Account

Home Forums Bug Reports ACF Is Not Defined – Admin Dashboard

Helping

ACF Is Not Defined – Admin Dashboard

  • 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.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

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.