当前位置: 首页>>代码示例>>PHP>>正文


PHP Walker_Nav_Menu::start_el方法代码示例

本文整理汇总了PHP中Walker_Nav_Menu::start_el方法的典型用法代码示例。如果您正苦于以下问题:PHP Walker_Nav_Menu::start_el方法的具体用法?PHP Walker_Nav_Menu::start_el怎么用?PHP Walker_Nav_Menu::start_el使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Walker_Nav_Menu的用法示例。


在下文中一共展示了Walker_Nav_Menu::start_el方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: start_el

 public function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0)
 {
     if ($this->has_children) {
         $before = '<input type="checkbox" id="cb_' . $item->ID . '">' . '<label class="sub-menu-toggle" for="cb_' . $item->ID . '"><span class="fa fa-chevron-down"></span></label>';
     }
     $output .= $before . parent::start_el($output, $item, $depth, $args, $id);
 }
开发者ID:stormwild,项目名称:6cpa,代码行数:7,代码来源:walker.php

示例2: array

 function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0)
 {
     $item_html = '';
     parent::start_el($item_html, $item, $depth, $args);
     $classes = empty($item->classes) ? array() : (array) $item->classes;
     $output .= $item_html;
 }
开发者ID:Stylize,项目名称:Fuel,代码行数:7,代码来源:navbar_walker.php

示例3: array

 function start_el(&$output, $item, $depth = 2, $args = array(), $id = 0)
 {
     $item_html = '';
     parent::start_el($item_html, $item, $depth, $args);
     $item_html = apply_filters('stachestack_wp_nav_menu_item', $item_html);
     $output .= $item_html;
 }
开发者ID:BeardandFedora,项目名称:StacheStack,代码行数:7,代码来源:class-StacheStack_Navlist_Walker.php

示例4: array

 function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0)
 {
     parent::start_el($output, $item, $depth, $args);
     if (!empty($item->description)) {
         $output .= sprintf('<i>%s</i>', esc_html($item->description));
     }
 }
开发者ID:rsantellan,项目名称:wordpress-ecommerce,代码行数:7,代码来源:menu.lib.php

示例5: array

 function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0)
 {
     if (0 == $depth) {
         return;
     }
     parent::start_el($output, $item, $depth, $args);
 }
开发者ID:standrewsdigital,项目名称:wp-peanut-butter-2015,代码行数:7,代码来源:navigation.php

示例6: array

 /**
  * @see Walker_Nav_Menu::start_el()
  * @since 1.0.0
  *
  * @param string $output Passed by reference. Used to append additional content.
  * @param object $object
  * @param int $depth Depth of menu item. Used for padding.
  * @param array|object $args
  * @param int $current_object_id
  * @internal param object $item Menu item data object.
  */
 function start_el(&$output, $object, $depth = 0, $args = array(), $current_object_id = 0)
 {
     $item_html = '';
     parent::start_el($item_html, $object, $depth, $args);
     $classes = empty($object->classes) ? array() : (array) $object->classes;
     //		FB::info($item_html, '$item_html');
     /*	$output .= ($depth == 0) ? '<li class="divider"></li>' : '';
     
     
     		$classes[] = 'menu-item-' . $object->ID;
     		$classes[] = ($depth == 0) ? 'title' : '';
     		$classes[] = (in_array('current-menu-item', $classes) && !in_array('active', $classes)) ? 'active' : '';
     
     
     		$class_names = join(' ', apply_filters('nav_menu_css_class', array_filter($classes), $object, $args));
     
     
     		$class_names = $class_names ? 'class="' . esc_attr($class_names) . '"' : '';*/
     //FB::info($object,'$object');
     if (in_array('label', $classes)) {
         $item_html = preg_replace('/<a[^>]*>(.*)<\\/a>/iU', '<label>$1</label>', $item_html);
     }
     if (in_array('divider', $classes)) {
         $item_html = preg_replace('/<a[^>]*>(.*)<\\/a>/iU', '', $item_html);
     }
     //		$indent = ($depth) ? str_repeat("\t", $depth) : '';
     //		$output .= $indent . '<li id="menu-item-' . $object->ID . ' " ng-class="$location.path()
     //		" ' . $class_names . '>';
     $output .= $item_html;
     //		parent::start_el($output, $object, $depth, $args);
     //		FB::info($output, ' $output');
 }
开发者ID:patlegris,项目名称:angularpresstheme,代码行数:43,代码来源:walkers.php

示例7: array

      function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0) {
        $item_html = '';
        parent::start_el( $item_html, $item, $depth, $args);

        if ( $item->is_dropdown ) {
          //makes top menu not clickable (default bootstrap behaviour)
          $search         = '<a';
          $replace        = ( ! wp_is_mobile() && 'hover' == esc_attr( TC_utils::$inst->tc_opt( 'tc_menu_type' ) ) ) ? $search : '<a class="dropdown-toggle" data-toggle="dropdown" data-target="#"';
          $replace       .= strpos($item_html, 'href=') ? '' : ' href="#"' ;
          $replace        = apply_filters( 'tc_menu_open_on_click', $replace , $search );
          $item_html      = str_replace( $search , $replace , $item_html);

          //adds arrows down
          if ( $depth === 0 )
              $item_html      = str_replace( '</a>' , ' <b class="caret"></b></a>' , $item_html);
        }
        elseif (stristr( $item_html, 'li class="divider' )) {
          $item_html = preg_replace( '/<a[^>]*>.*?<\/a>/iU' , '' , $item_html);
        }
        elseif (stristr( $item_html, 'li class="nav-header' )) {
          $item_html = preg_replace( '/<a[^>]*>(.*)<\/a>/iU' , '$1' , $item_html);
        }

        $output .= $item_html;
      }
开发者ID:niamherinoc,项目名称:rctractors,代码行数:25,代码来源:class-header-nav_walker.php

示例8: array

 function start_el(&$output, $object, $depth = 0, $args = array(), $current_object_id = 0)
 {
     $item_html = '';
     parent::start_el($item_html, $object, $depth, $args);
     $output .= $depth == 0 ? '' : '';
     $classes = empty($object->classes) ? array() : (array) $object->classes;
     // Fix dropdown menús con children - chevron
     $dropdownSections = ["nosotros", "about us"];
     foreach ($dropdownSections as $section) {
         if (in_array(str_replace(' ', '-', $section), $classes)) {
             $output .= '';
             $url = get_permalink(get_page_by_title($section)->ID);
             $replacement = "<i class=\"fa fa-chevron-down\"></i><a href=\"" . esc_url($url) . "\">" . ucfirst($section) . "</a>";
             $item_html = preg_replace('/<a[^>]*>(.*)<\\/a>/iU', $replacement, $item_html);
         }
     }
     //
     if (in_array('label', $classes)) {
         $output .= '';
         $item_html = preg_replace('/<a[^>]*>(.*)<\\/a>/iU', '<label>$1</label>', $item_html);
     }
     if (in_array('divider', $classes)) {
         $item_html = preg_replace('/<a[^>]*>( .* )<\\/a>/iU', '', $item_html);
     }
     $output .= $item_html;
 }
开发者ID:Calraiser,项目名称:flux,代码行数:26,代码来源:menu-walker.php

示例9:

 function start_el(&$output, $item, $depth, $args)
 {
     $item->title = str_repeat("-", $depth) . " " . $item->title;
     parent::start_el($output, $item, $depth, $args);
     $output = str_replace('<li', '<option value="' . $item->url . '"' . (in_array("current-menu-item", (array) $item->classes) ? ' selected="selected"' : ''), $output);
     $output = strip_tags($output, '<select>,<option>');
 }
开发者ID:DarussalamTech,项目名称:aims_prj,代码行数:7,代码来源:nav-menu-dropdown-walker.php

示例10:

 function start_el(&$output, $item, $depth, $args)
 {
     global $framework;
     $selected = $framework->get_current_url() == $item->url ? 'selected="selected"' : '';
     $item->title = str_repeat("&nbsp;", $depth * 4) . $item->title;
     parent::start_el($output, $item, $depth, $args);
     $output = str_replace('<li', '<option ' . $selected . ' value="' . $item->url . '"', $output);
 }
开发者ID:KurtMakesWeb,项目名称:CandG,代码行数:8,代码来源:functions.php

示例11: array

 function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0)
 {
     $item_html = '';
     parent::start_el($item_html, $item, $depth, $args);
     if ($item->is_dropdown) {
         $item_html = str_replace('</a>', '</a> <button class="sub-menu-unfold" aria-expanded="false"><span>' . __("Unfold Sub-Menu", "from-scratch") . '</span></button>', $item_html);
     }
     $output .= $item_html;
 }
开发者ID:anybodesign,项目名称:from-scratch,代码行数:9,代码来源:subnav-walker.php

示例12: start_el

 public function start_el(&$output, $item, $depth, $args)
 {
     // add spacing to the title based on the current depth
     $item->title = esc_attr($item->title);
     // call the prototype and replace the <li> tag
     // from the generated markup...
     parent::start_el(&$output, $item, $depth, $args);
     $output .= '	<option value="' . $item->url . '">' . $item->title;
 }
开发者ID:edisplay,项目名称:millennium-flights,代码行数:9,代码来源:Select_Nav_Walker.php

示例13: array

 function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0)
 {
     $item_html = '';
     parent::start_el($item_html, $item, $depth, $args);
     if ($item->is_dropdown && $depth === 0) {
         $item_html = str_replace('<a', '<a ' . display_control(), $item_html);
         $item_html = str_replace('</a>', ' <b class="caret"></b></a>', $item_html);
     }
     $output .= $item_html;
 }
开发者ID:Vikamoiseenko,项目名称:wp.itc210_psa-pbk,代码行数:10,代码来源:DD_Walker.php

示例14: empty

 function start_el(&$output, $item, $depth, $args)
 {
     $item_html = '';
     parent::start_el($item_html, $item, $depth, $args);
     $classes = empty($item->classes) ? array() : (array) $item->classes;
     if (in_array('section', $classes)) {
         $item_html = preg_replace('/<a[^>]*>(.*)<\\/a>/iU', '<label>$1</label>', $item_html);
     }
     $output .= $item_html;
 }
开发者ID:vibrains,项目名称:wp-foundation-starter,代码行数:10,代码来源:functions.php

示例15: array

 function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0)
 {
     $item_html = '';
     parent::start_el($item_html, $item, $depth, $args);
     if ($item->is_dropdown && $depth === 0) {
         $item_html = str_replace('<a', '<a class="dropdown-toggle"', $item_html);
     }
     $item_html = apply_filters('erh_wp_nav_menu_item', $item_html);
     $output .= $item_html;
 }
开发者ID:ehermanson,项目名称:wp-starter-bootstrap,代码行数:10,代码来源:walker.php


注:本文中的Walker_Nav_Menu::start_el方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。