Loads the plugin’s translated strings.
If the path is not given then it will be the root of the plugin directory. The .mo file should be named based on the domain with a dash, and then the locale exactly.
Signature
load_plugin_textdomain( $domain, $abs_rel_path = false, $plugin_rel_path = false )
- domain
- (string) Unique identifier for retrieving translated strings
- abs_rel_path
- (string) Optional. Relative path to ABSPATH of a folder, where the .mo file resides. Deprecated, but still functional until 2.7
Default:false - plugin_rel_path
- (string) Optional. Relative path to WP_PLUGIN_DIR. This is the preferred argument to use. It takes precedence over $abs_rel_path
Default:false
Return
(void)
Source
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;
}
$mofile = $path . '/'. $domain . '-' . $locale . '.mo';
return load_textdomain( $domain, $mofile );
}
WP Trac GitHub Bitbucket
Link here
-
URL
http://queryposts.com/function/load_plugin_textdomain/ -
HTML
<a href='http://queryposts.com/function/load_plugin_textdomain/'>load_plugin_textdomain()</a> -
Markdown
[load_plugin_textdomain()](http://queryposts.com/function/load_plugin_textdomain/) -
BBCode
[url=http://queryposts.com/function/load_plugin_textdomain/]load_plugin_textdomain()[/url]