name, $category ); // Set parent optgroup if( 0 == $depth ) { $this->optgroup = true; $output .= ''; } else { $this->optgroup = false; $output .= '"; } } /** * Ends the element output, if needed. * * @since 1.5.4 * @access public * * @param string $output Passed by reference. Used to append additional content. * @param object $page Not used. * @param int $depth Optional. Depth of category. Not used. * @param array $args Optional. An array of arguments. Only uses 'list' for whether should append * to output. See wp_list_categories(). Default empty array. */ public function end_el( &$output, $page, $depth = 0, $args = array() ) { if( 0 == $depth && true == $this->optgroup ) { $output .= ''; } } }