Filter continents in the first loop. see #3962
git-svn-id: http://svn.automattic.com/wordpress/trunk@10756 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
61b14efeba
commit
4510a068d4
|
@ -3094,11 +3094,15 @@ function wp_timezone_supported() {
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function wp_timezone_choice($selectedzone) {
|
function wp_timezone_choice($selectedzone) {
|
||||||
|
$continents = array('Africa', 'America', 'Antarctica', 'Arctic', 'Asia', 'Atlantic', 'Australia', 'Europe', 'Indian', 'Pacific', 'Etc');
|
||||||
|
|
||||||
$all = timezone_identifiers_list();
|
$all = timezone_identifiers_list();
|
||||||
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ( $all as $zone ) {
|
foreach ( $all as $zone ) {
|
||||||
$zone = explode('/',$zone);
|
$zone = explode('/',$zone);
|
||||||
|
if ( ! in_array($zone[0], $continents) )
|
||||||
|
continue;
|
||||||
$zonen[$i]['continent'] = isset($zone[0]) ? $zone[0] : '';
|
$zonen[$i]['continent'] = isset($zone[0]) ? $zone[0] : '';
|
||||||
$zonen[$i]['city'] = isset($zone[1]) ? $zone[1] : '';
|
$zonen[$i]['city'] = isset($zone[1]) ? $zone[1] : '';
|
||||||
$zonen[$i]['subcity'] = isset($zone[2]) ? $zone[2] : '';
|
$zonen[$i]['subcity'] = isset($zone[2]) ? $zone[2] : '';
|
||||||
|
@ -3109,14 +3113,10 @@ function wp_timezone_choice($selectedzone) {
|
||||||
$structure = '';
|
$structure = '';
|
||||||
$pad = ' ';
|
$pad = ' ';
|
||||||
|
|
||||||
$continents = array('Africa', 'America', 'Antarctica', 'Arctic', 'Asia', 'Atlantic', 'Australia', 'Europe', 'Indian', 'Pacific', 'Etc');
|
|
||||||
|
|
||||||
if ( empty($selectedzone) )
|
if ( empty($selectedzone) )
|
||||||
$structure .= '<option selected="selected" value="">' . __('Select a city') . "</option>\n";
|
$structure .= '<option selected="selected" value="">' . __('Select a city') . "</option>\n";
|
||||||
foreach ( $zonen as $zone ) {
|
foreach ( $zonen as $zone ) {
|
||||||
extract($zone);
|
extract($zone);
|
||||||
if ( ! in_array($continent, $continents) )
|
|
||||||
continue;
|
|
||||||
if ( empty($selectcontinent) && !empty($city) ) {
|
if ( empty($selectcontinent) && !empty($city) ) {
|
||||||
$selectcontinent = $continent;
|
$selectcontinent = $continent;
|
||||||
$structure .= '<optgroup label="'.$continent.'">' . "\n"; // continent
|
$structure .= '<optgroup label="'.$continent.'">' . "\n"; // continent
|
||||||
|
|
Loading…
Reference in New Issue