Home › Forums › General Issues › Javascript API › Reply To: Javascript API
When you enqueue a script you need to make sure you set the $depends argument.
wp_enqueue_script($handle, $src, array('acf-input'), $version, true);
it is best to enqueue your scripts on the ‘acf/admin_enqueue_scripts’ hook
add_action('acf/admin_enqueue_scripts', 'my_acf_scripts');
function my_acf_scripts() {
// enqueue scripts see above
}
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.