WordPress.org

Make WordPress Core

Changeset 14416


Ignore:
Timestamp:
05/03/2010 10:06:49 PM (11 years ago)
Author:
nbachiyski
Message:

Use get_available_languages() in options-general.php instead of manually looping on the language dir. Props sivel. Fixes #13023

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/options-general.php

    r14374 r14416  
    311311<?php do_settings_fields('general', 'default'); ?>
    312312<?php
    313 
    314 $lang_files = array();
    315 if ( is_multisite() && is_dir( ABSPATH . LANGDIR ) && $dh = opendir( ABSPATH . LANGDIR ) ) {
    316     while ( ( $lang_file = readdir( $dh ) ) !== false ) {
    317         if ( substr( $lang_file, -3 ) == '.mo' )
    318             $lang_files[] = $lang_file;
    319     }
    320 }
    321 
    322 if ( !empty($lang_files) ) {
     313    $languages = get_available_languages();
     314    if ( is_multisite() && !empty( $languages ) ):
    323315?>
    324316    <tr valign="top">
     
    326318        <td>
    327319            <select name="WPLANG" id="WPLANG">
    328                 <?php mu_dropdown_languages( $lang_files, get_option('WPLANG') ); ?>
     320                <?php mu_dropdown_languages( $languages, get_option('WPLANG') ); ?>
    329321            </select>
    330322        </td>
    331323    </tr>
    332324<?php
    333 } // languages
     325    endif;
    334326?>
    335327</table>
Note: See TracChangeset for help on using the changeset viewer.