Skip to content
Snippets Groups Projects
Commit ac546234 authored by Grzegorz Rola's avatar Grzegorz Rola
Browse files

Merge branch 'bugfix/plugin-text-domain-wp-6.7' into 'master'

bugfix(text domain): loading in WP 6.7

See merge request !7
parents 90c9f916 f81823b4
No related branches found
No related tags found
1 merge request!7bugfix(text domain): loading in WP 6.7
Pipeline #439620 failed with stages
in 33 seconds
## [1.2.1] - 2024-11-09
### Fixed
- WordPress 6.7 compatibility: loading text domain
## [1.2.0] - 2024-03-20
### Changed
- Usage tracker is initialized by the library after all plugin's hookables are registered.
......
......@@ -153,8 +153,13 @@ final class PluginBootstrap {
if ( method_exists( $plugin_info, 'get_language_dir' ) ) {
$lang_dir = $plugin_info->get_language_dir();
}
\load_plugin_textdomain( $plugin_info->get_text_domain(), \false,
basename( $plugin_info->get_plugin_dir() ) . "/$lang_dir/" );
add_action( 'init', function () use ( $plugin_info, $lang_dir ) {
\load_plugin_textdomain(
$plugin_info->get_text_domain(),
'',
basename( $plugin_info->get_plugin_dir() ) . "/$lang_dir/"
);
});
}
/**
......@@ -195,4 +200,4 @@ final class PluginBootstrap {
return $plugin_info;
}
}
\ No newline at end of file
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment