Created
April 4, 2013 05:50
-
-
Save ideag/5308138 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function load_plugin_textdomain( $domain, $abs_rel_path = false, $plugin_rel_path = false ) { | |
$locale = apply_filters( 'plugin_locale', get_locale(), $domain ); | |
if ( false !== $plugin_rel_path ) { | |
$path = WP_PLUGIN_DIR . '/' . trim( $plugin_rel_path, '/' ); | |
} else if ( false !== $abs_rel_path ) { | |
_deprecated_argument( __FUNCTION__, '2.7' ); | |
$path = ABSPATH . trim( $abs_rel_path, '/' ); | |
} else { | |
$path = WP_PLUGIN_DIR; | |
} | |
if (!is_readable($path)) { | |
$path = WPMU_PLUGIN_DIR . '/' . trim( $plugin_rel_path, '/' ); | |
} | |
$mofile = $path . '/'. $domain . '-' . $locale . '.mo'; | |
return load_textdomain( $domain, $mofile ); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment