Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




load_plugin_textdomain [ WordPress Function ]

load_plugin_textdomain ( $domain, $abs_rel_path = false, $plugin_rel_path = false )
Parameters:
  • (string) $domain Unique identifier for retrieving translated strings
  • (string) $abs_rel_path Optional. Relative path to ABSPATH of a folder, where the .mo file resides. Deprecated, but still functional until 2.7
  • (string) $plugin_rel_path Optional. Relative path to WP_PLUGIN_DIR. This is the preferred argument to use. It takes precedence over $abs_rel_path
Defined at:



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.

Source


<?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;
    }

    
$mofile $path '/'$domain '-' $locale '.mo';
    return 
load_textdomain$domain$mofile );
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics