mirror of
https://github.com/inretio/WordPress-Plugin-Boilerplate
synced 2025-01-03 01:33:54 +02:00
Make WP_LANG_DIR constant safer
We assume that someone defining WP_LANG_DIR will do so without a trailing slash, since we then add our own before adding in the rest of the path to the .mo file. This change gets removes that assumption by removing our own slash from the string, and wrapping WP_LANG_DIR in trailingslashit() instead.
This commit is contained in:
parent
dc4a71e101
commit
f9d97b8cb1
1 changed files with 1 additions and 1 deletions
|
@ -139,7 +139,7 @@ class Plugin_Name {
|
|||
$domain = $this->plugin_slug;
|
||||
$locale = apply_filters( 'plugin_locale', get_locale(), $domain );
|
||||
|
||||
load_textdomain( $domain, WP_LANG_DIR . '/' . $domain . '/' . $domain . '-' . $locale . '.mo' );
|
||||
load_textdomain( $domain, trailingslashit( WP_LANG_DIR ) . $domain . '/' . $domain . '-' . $locale . '.mo' );
|
||||
load_plugin_textdomain( $domain, FALSE, basename( dirname( __FILE__ ) ) . '/lang/' );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue