Fix i18n deprecation notice for translating too early

This commit is contained in:
David Stone
2025-02-15 15:06:43 -07:00
parent 6d7e7cef66
commit eb29a438a5
26 changed files with 98 additions and 104 deletions

View File

@ -237,11 +237,14 @@ abstract class Base_Element {
add_action('wu_element_preview', [$this, 'setup_preview']);
// Init should be the correct time to call this to avoid the deprecated notice from I18N.
// But it doesn't work for some reason, fix later.
// add_action('init', function () {
do_action('wu_element_loaded', $this);
// } );
add_action(
'init',
function () {
do_action('wu_element_loaded', $this);
},
5,
0
);
if ($this->public) {
self::register_public_element($this);