1
0
Fork 0
mirror of https://github.com/inretio/WordPress-Plugin-Boilerplate synced 2024-04-29 01:43:16 +03:00

Fix loading textdomain when the plugin is symlinked

plugin_basename doesn't return the correct path if the plugin is symlinked into webdir/wp-content/plugins/. This fixes the problem.
This commit is contained in:
Andrej Čremožnik 2013-07-16 13:14:30 +02:00
parent 86ecda68f6
commit 7e0d4a7cd8

View file

@ -135,7 +135,7 @@ class Plugin_Name {
$locale = apply_filters( 'plugin_locale', get_locale(), $domain );
load_textdomain( $domain, WP_LANG_DIR . '/' . $domain . '/' . $domain . '-' . $locale . '.mo' );
load_plugin_textdomain( $domain, FALSE, dirname( plugin_basename( __FILE__ ) ) . '/lang/' );
load_plugin_textdomain( $domain, FALSE, basename( dirname( __FILE__ ) ) . '/lang/' );
}
/**
@ -255,4 +255,4 @@ class Plugin_Name {
// TODO: Define your filter hook callback here
}
}
}