badget

Biggest Sale! Special Offer!

Get 50% discount on all of our single themes with this coupon code: #50%SALE

Hurry up! *Limited time offer*

PHP Notice: Translation loading triggered too early

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #113783
    eric-6211
    Participant

    Reposting here from WP theme repo support: https://wordpress.org/support/topic/php-notice-translation-loading-triggered-too-early/

    WP 6.8.1
    Clean Retina 3.0.7

    The following PHP notice is occuring in Clean Retina.

    Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the clean-retina 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 […redacted…]/wp-includes/functions.php on line 6114.

    This is happening because in clean-retina/functions.php the cleanretina_load_files() function defined on line 67 (which requires clean-retina/library/functions/i18n.php) is loaded on the cleanretina_init hook, which fires on line 156 of the same functions.php file. A theme’s functions.php file is loaded between the setup_theme and after_setup_theme WP hooks, both of which fire before the init hook that is supposed to be used for loading text domains.

    #113805

    Hello @eric-6211,

    Thank you for reporting the issue.

    This notice appears because translation functions or load_theme_textdomain() were being called too early in the WordPress loading process—specifically, before the init action. As of WordPress 6.7, this triggers a debug notice to help identify such cases.

    We’ve released an updated version that resolves this by ensuring translations are loaded at the correct point in the WordPress lifecycle.

    Thank you again for bringing this to our attention.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.