Здравствуйте, нужно исключить несколько children категорий (11, 12, 13) из вывода {catmenu} при subcat="only".
function recursive_array_search($needle, $haystack, $subcat = true, &$item = false) {
if(!$item) $item = array();
foreach($haystack as $key => $value) {
if(in_array($key, $needle)) {
if( $subcat === "only" ) {
if(is_array( $value['children'] )) {
foreach($value['children'] as $value2) {
$item[$value2['id']] = $value2;
}
}
} else $item[$key] = $value;
if(!$subcat AND is_array( $value['children'] ) ) {
unset($item[$key]['children']);
$this->recursive_array_search($needle, $value['children'], $subcat, $item);
}
} elseif (is_array( $value['children'] ) ) {
$this->recursive_array_search($needle, $value['children'], $subcat, $item);
}
}
return $item;
}