【发布时间】:2011-03-17 12:20:11
【问题描述】:
function garland_separate_terms($node_taxonomy) {
if ($node_taxonomy) {
foreach ($node_taxonomy AS $term) {
$links[$term->vid]['taxonomy_term_'. $term->tid] = array(
'title' => $term->name,
'href' => taxonomy_term_path($term),
'attributes' => array(
'rel' => 'tag',
'title' => strip_tags($term->description)
),
);
}
//theming terms out
foreach ($links AS $key => $vid) {
$terms[$key] = theme_links($vid);
}
}
return $terms;
}
这个函数我不是很懂。
- 为什么作者没有将 $node_taxonomy 声明为数组
($node_taxonomy=array())。 - 这个
$links[$term->vid]['taxonomy_term_'. $term->tid]来自哪里?
【问题讨论】: