Advertisement
Guest User

Untitled

a guest
Apr 7th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.70 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 3.0.8.0
  8. * @ Author : DeZender
  9. * @ Release on : 25.09.2017
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. class BS_Walker_Nav_Menu
  15. {
  16. /**
  17. * What the class handles.
  18. *
  19. * @see Walker::$tree_type
  20. * @since 3.0.0
  21. * @var string
  22. */
  23. public $tree_type = array(
  24. 'post_type',
  25. 'taxonomy',
  26. 'custom'
  27. );
  28. /**
  29. * Database fields to use.
  30. *
  31. * @see Walker::$db_fields
  32. * @since 3.0.0
  33. * @todo Decouple this.
  34. * @var array
  35. */
  36. public $db_fields = array(
  37. 'parent' => 'menu_item_parent',
  38. 'id' => 'db_id'
  39. );
  40.  
  41. /**
  42. * Starts the list before the elements are added.
  43. *
  44. * @see Walker::start_lvl()
  45. *
  46. * @since 3.0.0
  47. *
  48. * @param string $output Passed by reference. Used to append additional content.
  49. * @param int $depth Depth of menu item. Used for padding.
  50. * @param array $args An array of arguments. @see wp_nav_menu()
  51. */
  52. public function start_lvl(&$output, $depth = 0, $args = array( ))
  53. {
  54. $indent = str_repeat( "\t", $depth );
  55. $output .= "\n" . $indent . '<ul class="dropdown-menu">' . "\n";
  56. }
  57.  
  58. /**
  59. * Ends the list of after the elements are added.
  60. *
  61. * @see Walker::end_lvl()
  62. *
  63. * @since 3.0.0
  64. *
  65. * @param string $output Passed by reference. Used to append additional content.
  66. * @param int $depth Depth of menu item. Used for padding.
  67. * @param array $args An array of arguments. @see wp_nav_menu()
  68. */
  69. public function end_lvl(&$output, $depth = 0, $args = array( ))
  70. {
  71. $indent = str_repeat( "\t", $depth );
  72. $output .= $indent . '</ul>' . "\n";
  73. }
  74.  
  75. /**
  76. * Start the element output.
  77. *
  78. * @see Walker::start_el()
  79. *
  80. * @since 3.0.0
  81. * @since 4.4.0 'nav_menu_item_args' filter was added.
  82. *
  83. * @param string $output Passed by reference. Used to append additional content.
  84. * @param object $item Menu item data object.
  85. * @param int $depth Depth of menu item. Used for padding.
  86. * @param array $args An array of arguments. @see wp_nav_menu()
  87. * @param int $id Current item ID.
  88. */
  89. public function start_el(&$output, $item, $depth = 0, $args = array( ), $id = 0)
  90. {
  91. $indent = (($depth ? str_repeat( "\t", $depth ) : ''));
  92. $classes = ((empty( $item->classes ) ? array( ) : (array) $item->classes));
  93. $classes[] = 'menu-item-' . $item->ID;
  94. $args = apply_filters( 'nav_menu_item_args', $args, $item, $depth );
  95. $classes[] = ((in_array( 'current-menu-item', $classes ) ? 'active' : NULL));
  96. $a_class = ((in_array( 'menu-item-has-children', $classes ) ? 'dropdown-toggle' : NULL));
  97. $a_data_toggle = ((in_array( 'menu-item-has-children', $classes ) ? 'dropdown' : NULL));
  98. $a_role = ((in_array( 'menu-item-has-children', $classes ) ? 'button' : NULL));
  99. $a_aria_haspopup = ((in_array( 'menu-item-has-children', $classes ) ? 'true' : NULL));
  100. $a_aria_expanded = ((in_array( 'menu-item-has-children', $classes ) ? 'false' : NULL));
  101. $dropdown = ((in_array( 'menu-item-has-children', $classes ) ? 'dropdown ' : NULL));
  102. $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item, $args, $depth ) );
  103. $class_names = (($class_names ? ' class="' . $dropdown . esc_attr( $class_names ) . '"' : ''));
  104. $id = apply_filters( 'nav_menu_item_id', 'menu-item-' . $item->ID, $item, $args, $depth );
  105. $id = (($id ? ' id="' . esc_attr( $id ) . '"' : ''));
  106.  
  107. if (get_post_meta( $item->ID, 'menu-item-separator', true ) == '1') {
  108. $indent .= '<li role="separator" class="divider"></li>';
  109. ......................................................................................
  110. .............................................
  111. ..............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement