[wp-trac] [WordPress Trac] #62154: Latest beta Warnings Function load_plugin_textdomain was called incorrectly.
WordPress Trac
noreply at wordpress.org
Thu Oct 3 20:28:47 UTC 2024
#62154: Latest beta Warnings Function load_plugin_textdomain was called
incorrectly.
--------------------------+------------------------
Reporter: neo2k23 | Owner: (none)
Type: defect (bug) | Status: closed
Priority: normal | Milestone:
Component: I18N | Version: trunk
Severity: normal | Resolution: duplicate
Keywords: | Focuses:
--------------------------+------------------------
Comment (by room34):
Replying to [comment:2 swissspidy]:
> > Please provide details on how to fix them. It seems that almost every
plugin creates a issue.
>
> In most cases it means the plugin can simply remove any
`load_plugin_textdomain()` calls they have in their plugin. WordPress will
automatically load the translation for them.
>
> There can be more complex cases though, which the dev-note will cover.
Does WordPress automatically load the translations prior to 6.7, or is
that a new feature? If it's new, then we'd still need to keep the code in
the plugin for earlier WordPress versions, and add a version check to
determine whether or not to run the function.
Also, I'm not sure what the reason is, but my plugins are generating the
notice twice. That is to say, they were generating the notice twice when I
was calling `load_plugin_textdomain()` on the `plugins_loaded` hook. When
I move it to the `after_setup_theme` hook, I continue to get the notice
once.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/62154#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list