Skip to content

Commit

Permalink
fix: change action hook from 'plugins_loaded' to 'init' for correct l…
Browse files Browse the repository at this point in the history
…ocalization support
  • Loading branch information
lgersman committed Nov 28, 2024
1 parent 490d7e6 commit 48bd3c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/wp-plugin/test-plugin/test-plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
error_log("foo={$foo}");
});

\add_action('plugins_loaded', function (): void {
\add_action('init', function (): void {
\load_plugin_textdomain(domain: 'test-plugin', plugin_rel_path: basename(__DIR__) . '/languages/');

$translated_text = \__('hello.world', 'test-plugin');
Expand Down

0 comments on commit 48bd3c1

Please sign in to comment.