Add optional path arg to load_theme_textdomain(). Props filosofo. fixes #6951

git-svn-id: https://develop.svn.wordpress.org/trunk@9212 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2008-10-16 20:44:39 +00:00
parent 5f2a75db7b
commit 6e4773588a
1 changed files with 4 additions and 2 deletions

View File

@ -301,10 +301,12 @@ function load_plugin_textdomain($domain, $abs_rel_path = false, $plugin_rel_path
*
* @param string $domain Unique identifier for retrieving translated strings
*/
function load_theme_textdomain($domain) {
function load_theme_textdomain($domain, $path = false) {
$locale = get_locale();
$mofile = get_template_directory() . "/$locale.mo";
$path = ( empty( $path ) ) ? get_template_directory() : $path;
$mofile = "$path/$locale.mo";
load_textdomain($domain, $mofile);
}