0); if ( !empty($_GET['s']) ) $args['search'] = $_GET['s']; $categories = get_categories( $args ); } $children = _get_term_hierarchy('category'); if ( $categories ) { ob_start(); foreach ( $categories as $category ) { if ( $category->parent == $parent) { echo "\t" . _cat_row( $category, $level ); if ( isset($children[$category->term_id]) ) cat_rows( $category->term_id, $level +1, $categories ); } } $output = ob_get_contents(); ob_end_clean(); $output = apply_filters('cat_rows', $output); echo $output; } else { return false; } } function _cat_row( $category, $level, $name_override = false ) { global $class; $category = get_category( $category ); $pad = str_repeat( '— ', $level ); $name = ( $name_override ? $name_override : $pad . ' ' . $category->name ); if ( current_user_can( 'manage_categories' ) ) { $edit = "name)) . "'>$name"; } else { $edit = $name; } $class = " class='alternate'" == $class ? '' : " class='alternate'"; $category->count = number_format_i18n( $category->count ); $posts_count = ( $category->count > 0 ) ? "$category->count" : $category->count; $output = "