Fix PHP Notice: Function _load_textdomain_just_in_time was called incorrectly.#203
Conversation
There was a problem hiding this comment.
Changes look good to me, though interesting that we had so many labels defined that don't appear to be used anywhere.
One thing worth discussing here is that with this change, these labels can't easily be modified. Right now we use convert_to_blocks_define, which checks to see if a constant already exists and if so, it will use that value. This allows others to define these constants themselves (likely in wp-config.php) to easily modify these labels.
I'd be surprised if anyone is doing that but there may be some that are and that will no longer work after this change. Wondering if we need to try and maintain backwards compatibility on that? cc/ @dsawardekar
|
@dkotter It's been a while, iirc, This plugin was originally embedded within an existing code base, and all these labels were overridden there. Cleaning them up and removing the unused ones makes sense now. PR looks good to me as well. |
Description of the Change
There is a PHP Notices due to i18n functions being called early.
I've noticed that most of these labels aren't in use, and others are being translated again later (which doesn't seem ideal). Since they aren't being reused, I've deleted all label config defines and translated them when they are being used.
How to test the Change
Open wp-admin on the latest version of WordPress with WP_DEBUG set to true and your preferred method to look at PHP errors/notices. The notices will be removed with the changes.
Changelog Entry
Credits
Props @stormrockwell
Checklist: