GFCategoryWalker

The Gravity Forms GFCategoryWalker class.

Defined (1)

The class is defined in the following location(s).

/common.php  
  1. class GFCategoryWalker extends Walker { 
  2. /** 
  3. * @see Walker::$tree_type 
  4. * @since 2.1.0 
  5. * @var string 
  6. */ 
  7. var $tree_type = 'category'; 
  8.  
  9. /** 
  10. * @see Walker::$db_fields 
  11. * @since 2.1.0 
  12. * @todo Decouple this 
  13. * @var array 
  14. */ 
  15. var $db_fields = array( 'parent' => 'parent', 'id' => 'term_id' ); 
  16.  
  17. /** 
  18. * @see Walker::start_el() 
  19. * @since 2.1.0 
  20. * @param string $output Passed by reference. Used to append additional content. 
  21. * @param object $object Category data object. 
  22. * @param int $depth Depth of category. Used for padding. 
  23. * @param array $args Uses 'selected' and 'show_count' keys, if they exist. 
  24. * @param int $current_object_id 
  25. */ 
  26. function start_el( &$output, $object, $depth = 0, $args = array(), $current_object_id = 0 ) { 
  27. //$pad = str_repeat(' ', $depth * 3); 
  28. $pad = str_repeat( '─', $depth ); 
  29. if ( ! empty( $pad ) ) { 
  30. $pad .= ' '; 
  31. $object->name = "{$pad}{$object->name}"; 
  32. $output[] = $object;