コード例 #1
0
 function display_element($element, &$children_elements, $max_depth, $depth = 0, $args, &$output)
 {
     /*$display = false;
     
     		$id = $element->term_id;
     
     		$display = true;
     		if ( isset( $children_elements[ $id ] ) ) {
     			// the current term has children
     			foreach ( $children_elements[ $id ] as $child ) {
     				if ( in_array( $child->term_id, $this->term_ids ) ) {
     					// one of the term's children is in the list
     					$display = true;
     					// can stop searching now
     					break;
     				}
     			}
     		}
     
     		if ( $display )*/
     parent::display_element($element, $children_elements, $max_depth, $depth, $args, $output);
 }
コード例 #2
0
 function display_element($element, &$children_elements, $max_depth, $depth = 0, $args, &$output)
 {
     parent::display_element($element, $children_elements, $max_depth, $depth, $args, $output);
 }
コード例 #3
0
 /**
  * Traverse elements to create list from elements.
  *
  * Display one element if the element doesn't have any children otherwise,
  * display the element and its children. Will only traverse up to the max
  * depth and no ignore elements under that depth.
  *
  * This method shouldn't be called directly, use the walk() method instead.
  *
  * @see Walker::start_el()
  * @since 2.5.0
  *
  * @param object $element Data object
  * @param array $children_elements List of elements to continue traversing.
  * @param int $max_depth Max depth to traverse.
  * @param int $depth Depth of current element.
  * @param array $args
  * @param string $output Passed by reference. Used to append additional content.
  * @return null Null on failure with no changes to parameters.
  */
 public function display_element($element, &$children_elements, $max_depth, $depth, $args, &$output)
 {
     if (!$element) {
         return;
     }
     $id_field = $this->db_fields['id'];
     // Display this element.
     if (is_object($args[0])) {
         $args[0]->has_children = !empty($children_elements[$element->{$id_field}]);
     }
     parent::display_element($element, $children_elements, $max_depth, $depth, $args, $output);
 }