Make WordPress Core


Ignore:
Timestamp:
03/31/2011 08:11:30 AM (13 years ago)
Author:
dd32
Message:

Default WP_LANG_DIR to WP_CONTENT_DIR/languages when wp-includes/languages/ doesn't exist. Fixes #17006

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/load.php

    r17194 r17575  
    284284 * To set directory manually, define <code>WP_LANG_DIR</code> in wp-config.php.
    285285 *
    286  * First looks for language folder in WP_CONTENT_DIR and uses that folder if it
    287  * exists. Or it uses the "languages" folder in WPINC.
     286 * If the language directory exists within WP_CONTENT_DIR that is used
     287 * Otherwise if the language directory exists within WPINC, that's used
     288 * Finally, If neither of the preceeding directories is found,
     289 * WP_CONTENT_DIR/languages is used.
    288290 *
    289291 * The WP_LANG_DIR constant was introduced in 2.1.0.
     
    294296function wp_set_lang_dir() {
    295297    if ( !defined( 'WP_LANG_DIR' ) ) {
    296         if ( file_exists( WP_CONTENT_DIR . '/languages' ) && @is_dir( WP_CONTENT_DIR . '/languages' ) ) {
     298        if ( file_exists( WP_CONTENT_DIR . '/languages' ) && @is_dir( WP_CONTENT_DIR . '/languages' ) || !@is_dir(ABSPATH . WPINC . '/languages') ) {
    297299            define( 'WP_LANG_DIR', WP_CONTENT_DIR . '/languages' ); // no leading slash, no trailing slash, full path, not relative to ABSPATH
    298300            if ( !defined( 'LANGDIR' ) ) {
Note: See TracChangeset for help on using the changeset viewer.