'',
2 => '',
3 => 'Over 800 MW solar power plants on hand in operation.',
4 => '',
5 => ''
);
for ($i = 1; $i <= $items_count; $i++) {
$default_year = isset($default_years[$i-1]) ? $default_years[$i-1] : (2008 + $i);
$default_desc = isset($default_descriptions[$i]) ? $default_descriptions[$i] : '';
$year = get_theme_mod('development_history_item_' . $i . '_year', $default_year);
$description = get_theme_mod('development_history_item_' . $i . '_description', $default_desc);
$history_items[] = array(
'year' => $year,
'description' => $description,
'active' => get_theme_mod('development_history_item_' . $i . '_active', $i == 3) // 默认第3个激活
);
}
// 如果没有设置任何历史项目,使用默认数据
if (empty($history_items)) {
$history_items = array(
array('year' => '2009', 'description' => '', 'active' => false),
array('year' => '2012', 'description' => '', 'active' => false),
array('year' => '2015', 'description' => 'Over 800 MW solar power plants on hand in operation.', 'active' => true),
array('year' => '2021', 'description' => '', 'active' => false),
array('year' => '2022', 'description' => '', 'active' => false),
);
}
// 找到默认激活的项目
$default_active_index = 0;
foreach ($history_items as $index => $item) {
if ($item['active']) {
$default_active_index = $index;
break;
}
}
?>