Support

Account

Home Forums Front-end Issues Error after updating

Solved

Error after updating

  • Hi I am getting this error after updating:

    Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the acf domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/grahamcd/public_html/wp-includes/functions.php on line 6121

  • I’m seeing the same issue. I just updated to WordPress 6.8. I’m using ACF Pro with a custom hybrid theme (uses the Block Editor but not the Site Editor).

  • Same here. Just updated, just started getting the error.

  • Hey folks,

    If you’re getting this error, and you’ve upgraded to ACF 6.4.0, it means you’ve code in your custom plugins or theme that is forcing ACF to initialise too early.

    This is likely to be called like get_field or acf_add_options_page.

    Once you’ve found the ACF calls which are happening too early, you can wrap the code in:
    add_action('acf/init', function() { [existing code] });

    to resolve this error.

    Thanks,
    Liam

  • Thanks for this explanation
    I have the same issue since the ACF update

    [24-Apr-2025 07:59:47 UTC] PHP Notice: La fonction _load_textdomain_just_in_time a été appelée de façon <strong>incorrecte</strong>. Le chargement de la traduction pour le domaine <code>acf</code> a été déclenché trop tôt. Cela indique généralement que du code dans l’extension ou le thème s’exécute trop tôt. Les traductions doivent être chargées au moment de l’action <code>init</code> ou plus tard. Veuillez lire <a href="https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/">Débogage dans WordPress</a> (en) pour plus d’informations. (Ce message a été ajouté à la version 6.7.0.) in /wp-includes/functions.php on line 6121

    unfortunatly, making those notices happening on a fully previously functional site because of a pluggin update is really tricky to debug
    during dev work, it’s fine to debug, but on production site it’s a real problem : since the warning is sent by /wp-includes/pluggable.php without any other informations in the debug file.

    I understand that ACF team feels a little concerned by the situation, and not just claim we are poor devs, since you published a quick fix in 6.4.1 :

    Fix - Various translations are no longer called before the WordPress init action hook

    Do you have any further advice to track the problem ?
    Thanks in advance.

  • Hey there, we had some fixes to make our side which we did in 6.4.0.

    This issue hasn’t come about because of an ACF update, however – it’s WordPress 6.8 which has triggered the error. Our fixes brought our core to be compatible with WordPress 6.8, but the error can still happen if your code triggers ACF to initialise early. We could prevent ACF ever initialising early, but that would result in broken sites, rather than sites with warnings, so it’s definitely not the best option here.

    We’re looking at adding a _doing_it_wrong additional notice in our next release if you trigger this error, which would help you figure out where the problem is in your code at the expense of double the notices.

    For now, your best bet is to check your functions.php file for get_field or acf_add_options_page as they tend to be the two places we’ve seen most commonly trigging this.

    Thanks,
    Liam

  • Hi there,

    I’m having the same issue but struggling to implement the fix as it seems either to be ineffective or site-breaking. Hopefully you can show me what I’m missing!

    Query Monitor is telling me the function that’s falling over – the ‘tmea_get_country()’ function:
    get_field()
    wp-content/plugins/advanced-custom-fields-pro/includes/api/api-template.php:23
    tmea_get_country()
    wp-content/themes/tmea_theme/functions.php:24

    The function is very simple – it just works out which country that site is set up for:

    function tmea_get_country()
    {
    	//default to UK if no country found
    	if (!function_exists('get_field')) {
    		$tmea_country = 'UK';
    	} else {
    		$tmea_country = get_field('tmea_country', 'option');
    	}
    	return $tmea_country;
    }

    I tried putting that function in the add_action() as recommended above, but it didn’t work.
    add_action('acf/init', 'tmea_get_country', 10)

    The first call for that function is a couple of lines later:

    require_once(__DIR__ . '/functions_' . strtolower(tmea_get_country()) . '.php');

    Putting that in the add_action broke the site because various functions weren’t available.

    How can I resolve this, please?

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

You must be logged in to reply to this topic.