ACF, Programming, WordPress

WordPress Mutisite PHP Fatal error: Call to undefined function get_field() when creating user

Suppose, you have set up Multisite and use get_field() function (Activated ACF Plugin) in your header.php file to get custom filed content.

This has no issue for normal site without network but, for Multisite, when a new user is registered, the user gets an activation email with a link to YOUR-SITE-URL/wp-activate.php?key=RANDOMKEY. This link however turns out blank, without being able to access the get_field function. To display activation link content, you can wrap the call to get_field in an “if function_exist(‘get_field’)” function, which solves your issue but this obviously, can’t load the contents of custom fields.

To fix the undefined function issue, load acf.php in your function.php .

include_once(WP_PLUGIN_DIR.'/advanced-custom-fields-pro/acf.php');

 

Views: 2320

Standard

One thought on “WordPress Mutisite PHP Fatal error: Call to undefined function get_field() when creating user

Comments are closed.