コード例 #1
0
 /**
  * Start the element output.
  *
  * @see Walker::start_el()
  *
  * @param string Passed by reference. Used to append additional content.
  * @param object Taxonomy data object.
  * @param int    Depth of category in reference to parents. Default 0.
  * @param array  An array of arguments. @see wp_list_categories()
  * @param int    ID of the current category.
  */
 function start_el(&$output, $taxonomy_object, $depth = 0, $args = array(), $id = 0)
 {
     if (isset($this->mla_terms[$taxonomy_object->term_taxonomy_id])) {
         $taxonomy_object->count = $this->mla_terms[$taxonomy_object->term_taxonomy_id];
     }
     parent::start_el($output, $taxonomy_object, $depth, $args, $id);
 }
コード例 #2
0
 public function start_el(&$output, $category, $depth, $args)
 {
     parent::start_el($output, $category, $depth, $args);
     $find = 'cat-item-' . $category->term_id . '"';
     $replace = $category->slug . '"';
     $output = str_replace($find, $replace, $output);
 }