From f597e2fe949a1e18eb778b9a5bd102de88570555 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 18 May 2017 14:03:27 +0200 Subject: Initial commit. --- inc/bootstrap-wp-navwalker.php | 223 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 223 insertions(+) create mode 100644 inc/bootstrap-wp-navwalker.php (limited to 'inc/bootstrap-wp-navwalker.php') diff --git a/inc/bootstrap-wp-navwalker.php b/inc/bootstrap-wp-navwalker.php new file mode 100644 index 0000000..d175e56 --- /dev/null +++ b/inc/bootstrap-wp-navwalker.php @@ -0,0 +1,223 @@ +\n"; + } + + /** + * @see Walker::start_el() + * @since 3.0.0 + * + * @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 int $current_page Menu item ID. + * @param object $args + */ + public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { + $indent = ( $depth ) ? str_repeat( "\t", $depth ) : ''; + + /** + * Dividers, Headers or Disabled + * ============================= + * Determine whether the item is a Divider, Header, Disabled or regular + * menu item. To prevent errors we use the strcasecmp() function to so a + * comparison that is not case sensitive. The strcasecmp() function returns + * a 0 if the strings are equal. + */ + if ( strcasecmp( $item->attr_title, 'divider' ) == 0 && $depth === 1 ) { + $output .= $indent . ''; + $fb_output .= ''; + + if ( $container ) + $fb_output .= ''; + + echo $fb_output; + } + } +} -- cgit v1.2.3