Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP5 Decoder for ionCube Encoder)
- *
- * @ Version : 3.0.8.0
- * @ Author : DeZender
- * @ Release on : 25.09.2017
- * @ Official site : http://DeZender.Net
- *
- */
- class BS_Walker_Nav_Menu
- {
- /**
- * What the class handles.
- *
- * @see Walker::$tree_type
- * @since 3.0.0
- * @var string
- */
- public $tree_type = array(
- 'post_type',
- 'taxonomy',
- 'custom'
- );
- /**
- * Database fields to use.
- *
- * @see Walker::$db_fields
- * @since 3.0.0
- * @todo Decouple this.
- * @var array
- */
- public $db_fields = array(
- 'parent' => 'menu_item_parent',
- 'id' => 'db_id'
- );
- /**
- * Starts the list before the elements are added.
- *
- * @see Walker::start_lvl()
- *
- * @since 3.0.0
- *
- * @param string $output Passed by reference. Used to append additional content.
- * @param int $depth Depth of menu item. Used for padding.
- * @param array $args An array of arguments. @see wp_nav_menu()
- */
- public function start_lvl(&$output, $depth = 0, $args = array( ))
- {
- $indent = str_repeat( "\t", $depth );
- $output .= "\n" . $indent . '<ul class="dropdown-menu">' . "\n";
- }
- /**
- * Ends the list of after the elements are added.
- *
- * @see Walker::end_lvl()
- *
- * @since 3.0.0
- *
- * @param string $output Passed by reference. Used to append additional content.
- * @param int $depth Depth of menu item. Used for padding.
- * @param array $args An array of arguments. @see wp_nav_menu()
- */
- public function end_lvl(&$output, $depth = 0, $args = array( ))
- {
- $indent = str_repeat( "\t", $depth );
- $output .= $indent . '</ul>' . "\n";
- }
- /**
- * Start the element output.
- *
- * @see Walker::start_el()
- *
- * @since 3.0.0
- * @since 4.4.0 'nav_menu_item_args' filter was added.
- *
- * @param string $output Passed by reference. Used to append additional content.
- * @param object $item Menu item data object.
- * @param int $depth Depth of menu item. Used for padding.
- * @param array $args An array of arguments. @see wp_nav_menu()
- * @param int $id Current item ID.
- */
- public function start_el(&$output, $item, $depth = 0, $args = array( ), $id = 0)
- {
- $indent = (($depth ? str_repeat( "\t", $depth ) : ''));
- $classes = ((empty( $item->classes ) ? array( ) : (array) $item->classes));
- $classes[] = 'menu-item-' . $item->ID;
- $args = apply_filters( 'nav_menu_item_args', $args, $item, $depth );
- $classes[] = ((in_array( 'current-menu-item', $classes ) ? 'active' : NULL));
- $a_class = ((in_array( 'menu-item-has-children', $classes ) ? 'dropdown-toggle' : NULL));
- $a_data_toggle = ((in_array( 'menu-item-has-children', $classes ) ? 'dropdown' : NULL));
- $a_role = ((in_array( 'menu-item-has-children', $classes ) ? 'button' : NULL));
- $a_aria_haspopup = ((in_array( 'menu-item-has-children', $classes ) ? 'true' : NULL));
- $a_aria_expanded = ((in_array( 'menu-item-has-children', $classes ) ? 'false' : NULL));
- $dropdown = ((in_array( 'menu-item-has-children', $classes ) ? 'dropdown ' : NULL));
- $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item, $args, $depth ) );
- $class_names = (($class_names ? ' class="' . $dropdown . esc_attr( $class_names ) . '"' : ''));
- $id = apply_filters( 'nav_menu_item_id', 'menu-item-' . $item->ID, $item, $args, $depth );
- $id = (($id ? ' id="' . esc_attr( $id ) . '"' : ''));
- if (get_post_meta( $item->ID, 'menu-item-separator', true ) == '1') {
- $indent .= '<li role="separator" class="divider"></li>';
- ......................................................................................
- .............................................
- ..............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement