hlashbrooke / WordPress-Plugin-Template

A robust code template for creating a standards-compliant WordPress plugin.
https://hughlashbrooke.com/
GNU General Public License v2.0
1.03k stars 329 forks source link

update init localization according to WP >= 4.6 documentation #89

Closed cornelRaiu closed 4 years ago

cornelRaiu commented 4 years ago

According to the WP documentation here:

https://developer.wordpress.org/reference/functions/load_plugin_textdomain/

since WP 4.6 load_plugin_textdomain now tries to load the .mo file from the languages directory first. It also applies the plugin_locale filter so the code doing that in the plugin template is redundant.

If you think it is necessary I can make this method check for the current WP version and load the localization the old way if version is lower than 4.6.

Let me know.

cornelRaiu commented 4 years ago

I tried to move this PR against develop but it seems there is another commit done on master that would need to be merged into develop so I moved it back against master. Let me know if I should close this PR and submit one against develop. Thank you for this nice template!