Home › Forums › Bug Reports › Calling get_field() within acf/init causes PHP notice › Reply To: Calling get_field() within acf/init causes PHP notice
Yes I’m sure.
I inserted
debug_print_backtrace(); die();
in acf-value-functions.php on line 351 and the stacktrace showed me exactly the call in the acf/init action.
#0 acf_log_invalid_field_notice(Array ([ID] => 0,[key] => ,[label] => ,[name] => theme_mapbox_access_token,[prefix] => ,[type] => ,[value] => ,[menu_order] => 0,[instructions] => ,[required] => ,[id] => ,[class] => ,[conditional_logic] => ,[parent] => 0,[wrapper] => Array ([width] => ,[class] => ,[id] => ),[_name] => theme_mapbox_access_token,[_valid] => 1), acf_get_value) called at [/var/www/clients/client1/web4/web/wp-includes/class-wp-hook.php:303]
#1 WP_Hook->apply_filters(, Array ([0] => Array ([ID] => 0,[key] => ,[label] => ,[name] => theme_mapbox_access_token,[prefix] => ,[type] => ,[value] => ,[menu_order] => 0,[instructions] => ,[required] => ,[id] => ,[class] => ,[conditional_logic] => ,[parent] => 0,[wrapper] => Array ([width] => ,[class] => ,[id] => ),[_name] => theme_mapbox_access_token,[_valid] => 1),[1] => acf_get_value)) called at [/var/www/clients/client1/web4/web/wp-includes/class-wp-hook.php:327]
#2 WP_Hook->do_action(Array ([0] => Array ([ID] => 0,[key] => ,[label] => ,[name] => theme_mapbox_access_token,[prefix] => ,[type] => ,[value] => ,[menu_order] => 0,[instructions] => ,[required] => ,[id] => ,[class] => ,[conditional_logic] => ,[parent] => 0,[wrapper] => Array ([width] => ,[class] => ,[id] => ),[_name] => theme_mapbox_access_token,[_valid] => 1),[1] => acf_get_value)) called at [/var/www/clients/client1/web4/web/wp-includes/plugin.php:470]
#3 do_action(acf/get_invalid_field_value, Array ([ID] => 0,[key] => ,[label] => ,[name] => theme_mapbox_access_token,[prefix] => ,[type] => ,[value] => ,[menu_order] => 0,[instructions] => ,[required] => ,[id] => ,[class] => ,[conditional_logic] => ,[parent] => 0,[wrapper] => Array ([width] => ,[class] => ,[id] => ),[_name] => theme_mapbox_access_token,[_valid] => 1), acf_get_value) called at [/var/www/clients/client1/web4/web/wp-content/themes/pixelcube/lib/advanced-custom-fields-pro/includes/acf-value-functions.php:72]
#4 acf_get_value(options, Array ([ID] => 0,[key] => ,[label] => ,[name] => theme_mapbox_access_token,[prefix] => ,[type] => ,[value] => ,[menu_order] => 0,[instructions] => ,[required] => ,[id] => ,[class] => ,[conditional_logic] => ,[parent] => 0,[wrapper] => Array ([width] => ,[class] => ,[id] => ),[_name] => theme_mapbox_access_token,[_valid] => 1)) called at [/var/www/clients/client1/web4/web/wp-content/themes/pixelcube/lib/advanced-custom-fields-pro/includes/api/api-template.php:45]
#5 get_field(theme_mapbox_access_token, options) called at [/var/www/clients/client1/web4/web/wp-content/themes/pixelcube/functions/mapbox/class-customtheme-mapbox.php:17]
#6 Customtheme_Mapbox::{closure}(5) called at [/var/www/clients/client1/web4/web/wp-includes/class-wp-hook.php:303]
#7 WP_Hook->apply_filters(, Array ([0] => 5)) called at [/var/www/clients/client1/web4/web/wp-includes/class-wp-hook.php:327]
#8 WP_Hook->do_action(Array ([0] => 5)) called at [/var/www/clients/client1/web4/web/wp-includes/plugin.php:470]
#9 do_action(acf/init, 5) called at [/var/www/clients/client1/web4/web/wp-content/themes/pixelcube/lib/advanced-custom-fields-pro/acf.php:332]
#10 ACF->init() called at [/var/www/clients/client1/web4/web/wp-content/themes/pixelcube/lib/advanced-custom-fields-pro/includes/api/api-helpers.php:226]
#11 acf_init() called at [/var/www/clients/client1/web4/web/wp-content/themes/pixelcube/lib/advanced-custom-fields-pro/includes/api/api-template.php:144]
#12 acf_maybe_get_field(theme_header_nav_type, options) called at [/var/www/clients/client1/web4/web/wp-content/themes/pixelcube/lib/advanced-custom-fields-pro/includes/api/api-template.php:26]
#13 get_field(theme_header_nav_type, options) called at [/var/www/clients/client1/web4/web/wp-content/themes/pixelcube/class-customtheme.php:127]
#14 Customtheme::load_header_nav() called at [/var/www/clients/client1/web4/web/wp-content/themes/pixelcube/functions.php:65]
#15 include(/var/www/clients/client1/web4/web/wp-content/themes/pixelcube/functions.php) called at [/var/www/clients/client1/web4/web/wp-settings.php:546]
#16 require_once(/var/www/clients/client1/web4/web/wp-settings.php) called at [/var/www/clients/client1/web4/web/wp-config.php:131]
#17 require_once(/var/www/clients/client1/web4/web/wp-config.php) called at [/var/www/clients/client1/web4/web/wp-load.php:50]
#18 require_once(/var/www/clients/client1/web4/web/wp-load.php) called at [/var/www/clients/client1/web4/web/wp-blog-header.php:13]
#19 require(/var/www/clients/client1/web4/web/wp-blog-header.php) called at [/var/www/clients/client1/web4/web/index.php:17]
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.