Switch language

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




wp_set_lang_dir [ WordPress Function ]

wp_set_lang_dir ( No parameters )
Access:
  • private
Defined at:



Sets the location of the language directory.

To set directory manually, define

WP_LANG_DIR

in wp-config.php.

If the language directory exists within WP_CONTENT_DIR, that is used. Otherwise if the language directory exists within WPINC, that's used. Finally, if neither of the preceding directories are found, WP_CONTENT_DIR/languages is used.

The WP_LANG_DIR constant was introduced in 2.1.0.

Source


<?php
function wp_set_lang_dir() {
    if ( !
defined'WP_LANG_DIR' ) ) {
        if ( 
file_existsWP_CONTENT_DIR '/languages' ) && @is_dirWP_CONTENT_DIR '/languages' ) || !@is_dir(ABSPATH WPINC '/languages') ) {
            
define'WP_LANG_DIR'WP_CONTENT_DIR '/languages' ); // no leading slash, no trailing slash, full path, not relative to ABSPATH
            
if ( !defined'LANGDIR' ) ) {
                
// Old static relative path maintained for limited backwards compatibility - won't work in some cases
                
define'LANGDIR''wp-content/languages' );
            }
        } else {
            
define'WP_LANG_DIR'ABSPATH WPINC '/languages' ); // no leading slash, no trailing slash, full path, not relative to ABSPATH
            
if ( !defined'LANGDIR' ) ) {
                
// Old relative path maintained for backwards compatibility
                
define'LANGDIR'WPINC '/languages' );
            }
        }
    }
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



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