Home › Forums › Backend Issues (wp-admin) › Uncaught Type Error › Reply To: Uncaught Type Error
That is because ACF is trying to load the scripts that should only be loaded on the front end in the admin. The WP init hook fires on both the front end and admin. If you want to do this with a hook then you need to make sure you’re not loading an admin page.
add_action('init', 'brandpage_form_head');
function brandpage_form_head() {
if (!is_admin()) {
acf_form_head();
}
}
I’m not 100% sure it will work though. init is an extremely early hook. Have you tested it on forms on the front end?
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.