8000
Skip to content
This repository was archived by the owner on Jul 28, 2026. It is now read-only.
This repository was archived by the owner on Jul 28, 2026. It is now read-only.

Translation loading for anspress-question-answer domain triggered too early (WP 6.7+ warning) #935

Description

@Netscype

After updating to WordPress 6.7, a new warning appears when WP_DEBUG is enabled. The plugin is loading the anspress-question-answer textdomain too early—likely before the init hook. This behavior now triggers a warning in WordPress core.

Warning message (from debug.log):

text
Copy
Edit
Notice: Function _load_textdomain_just_in_time was called incorrectly.
Translation loading for the anspress-question-answer 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 /wp-includes/functions.php on line 6121
Suggested Fix:
Move the load_plugin_textdomain() call into an init hook like this:

php
Copy
Edit
add_action( 'init', function() {
load_plugin_textdomain( 'anspress-question-answer', false, plugin_basename( dirname( FILE ) ) . '/languages' );
});
Environment Details:

WordPress: 6.7.x

AnsPress version: August 2024 release

PHP version: 8.1 / 8.2 (tested on both)

Theme: OceanWP (frontend)

Note:
This is not a breaking bug, but the notice appears prominently during development or on staging sites with debugging enabled. It would be great to see this adjusted in the next update. Thank you for your continued work on AnsPress!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    0