Skip to content

imagify_load_translations() loaded too early #975

@markonikolic985

Description

@markonikolic985

Describe the bug
User reported a problem with Imagify translation loaded too early and proposed the fix by updating imagify_load_translations() function this way:

`function imagify_load_translations() {
static $done = false;

if ( $done ) {
    return;
}

$done = true;

// Load translations after the 'init' action
add_action('init', function() {
    load_plugin_textdomain( 'imagify', false, dirname( plugin_basename( IMAGIFY_FILE ) ) . '/languages/' );
});

}`

WP.org thread can be found here

The issue appears as PHP warning in the logs.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions