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


PHP Walker_Nav_Menu::display_element方法代码示例

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


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

示例1: isset

 function display_element($element, &$children_elements, $max_depth, $depth = 0, $args, &$output)
 {
     // check whether this item has children, and set $item->hasChildren accordingly
     $element->hasChildren = isset($children_elements[$element->ID]) && !empty($children_elements[$element->ID]);
     // continue with normal behavior
     return parent::display_element($element, $children_elements, $max_depth, $depth, $args, $output);
 }
开发者ID:aaronramirez,项目名称:ssbd,代码行数:7,代码来源:bootstrap-walker.php

示例2:

 function display_element($element, &$children_elements, $max_depth, $depth = 0, $args, &$output)
 {
     $element->has_children = !empty($children_elements[$element->ID]);
     $element->classes[] = $element->current || $element->current_item_ancestor ? 'active' : '';
     $element->classes[] = $element->has_children && 1 !== $max_depth ? 'has-submenu' : '';
     parent::display_element($element, $children_elements, $max_depth, $depth, $args, $output);
 }
开发者ID:rollandwalsh,项目名称:third-rail-wp,代码行数:7,代码来源:offcanvas-walker.php

示例3: count

 function display_element($element, &$children_elements, $max_depth, $depth = 0, $args, &$output)
 {
     $id_field = $this->db_fields['id'];
     if (is_object($args[0])) {
         $args[0]->has_children = !empty($children_elements[$element->{$id_field}]);
         $args[0]->is_bordered = $element->_dfd_mega_menu_bordered == 1;
     }
     if ($depth == 0 && $element->_dfd_mega_menu_enabled == 1 && !empty($children_elements[$element->{$id_field}])) {
         $columns = $element->_dfd_mega_menu_columns;
         $cnt = count($children_elements[$element->{$id_field}]);
         if ($columns > 1 && $cnt > 1) {
             $delim_step = ceil($cnt / $columns);
             for ($i = 0; $i < $cnt; $i++) {
                 if ($i == $cnt - 1 && $cnt % $delim_step !== 0) {
                     $children_elements[$element->{$id_field}][$i]->is_mega_unlast = true;
                 }
                 if ($i == 0 || $i % $delim_step !== 0) {
                     continue;
                 }
                 $children_elements[$element->{$id_field}][$i]->is_mega_delim = true;
             }
         }
     }
     return parent::display_element($element, $children_elements, $max_depth, $depth, $args, $output);
 }
开发者ID:sabdev1,项目名称:ljcdevsab,代码行数:25,代码来源:front_mega_menu_walker.php

示例4:

 function display_element($element, &$children_elements, $max_depth, $depth = 0, $args, &$output)
 {
     //we add a property here
     //will be used in override start_el() and class filter
     $element->is_dropdown = !empty($children_elements[$element->ID]);
     //let the parent do the rest of the job !
     parent::display_element($element, $children_elements, $max_depth, $depth, $args, $output);
 }
开发者ID:vhngroup,项目名称:customizr,代码行数:8,代码来源:class-header-nav_walker.php

示例5: display_element

 public function display_element($el, &$children, $max_depth, $depth = 0, $args, &$output)
 {
     $id = $this->db_fields['id'];
     if (isset($children[$el->{$id}])) {
         $el->classes[] = 'has_children';
     }
     parent::display_element($el, $children, $max_depth, $depth, $args, $output);
 }
开发者ID:JalpMi,项目名称:v2contact,代码行数:8,代码来源:functions.php

示例6: isset

 /**
  * Traverse elements to create list from elements.
  *
  * Display one element if the element doesn't have any children otherwise,
  * display the element and its children. Will only traverse up to the max
  * depth and no ignore elements under that depth. It is possible to set the
  * max depth to include all depths, see walk() method.
  *
  * This method shouldn't be called directly, use the walk() method instead.
  *
  * @since 2.5.0
  *
  * @param object $element Data object
  * @param array $children_elements List of elements to continue traversing.
  * @param int $max_depth Max depth to traverse.
  * @param int $depth Depth of current element.
  * @param array $args
  * @param string $output Passed by reference. Used to append additional content.
  * @return null Null on failure with no changes to parameters.
  */
 function display_element($element, &$children_elements, $max_depth, $depth = 0, $args, &$output)
 {
     if (!$element) {
         return;
     }
     $element->hasChildren = isset($children_elements[$element->ID]) && !empty($children_elements[$element->ID]);
     return parent::display_element($element, $children_elements, $max_depth, $depth, $args, $output);
 }
开发者ID:nikolaskarica,项目名称:bds-alliance,代码行数:28,代码来源:GummNavMenuWalker.php

示例7: display_element

 function display_element($element, &$children_elements, $max_depth, $depth = 0, $args, &$output)
 {
     $id_field = $this->db_fields['id'];
     if (!empty($children_elements[$element->{$id_field}])) {
         $element->classes[] = 'menu-has-children';
     }
     Walker_Nav_Menu::display_element($element, $children_elements, $max_depth, $depth, $args, $output);
 }
开发者ID:VadimSid,项目名称:thinkgreek,代码行数:8,代码来源:functions.php

示例8:

 function display_element($element, &$children_elements, $max_depth, $depth = 0, $args, &$output)
 {
     $element->is_dropdown = !empty($children_elements[$element->ID]) && ($depth + 1 < $max_depth || $max_depth === 0);
     if ($element->is_dropdown) {
         $element->classes[] = 'dropdown';
     }
     parent::display_element($element, $children_elements, $max_depth, $depth, $args, $output);
 }
开发者ID:riseofthetigers,项目名称:wxp-starter-theme,代码行数:8,代码来源:nav.php

示例9: array

 function display_element($element, &$children_elements, $max_depth, $depth = 0, $args, &$output)
 {
     //we add a property here
     //will be used in override start_el() and class filter
     $element->is_dropdown = !empty($children_elements[$element->ID]);
     $element->classes = apply_filters('tc_nav_menu_css_class', array_filter(empty($element->classes) ? array() : (array) $element->classes), $element, $args, $depth);
     //let the parent do the rest of the job !
     parent::display_element($element, $children_elements, $max_depth, $depth, $args, $output);
 }
开发者ID:ravenvn,项目名称:sandau,代码行数:9,代码来源:class-header-nav_walker.php

示例10: display_element

 /**
  * Traverse elements to create list from elements.
  *
  * Display one element if the element doesn't have any children otherwise,
  * display the element and its children. Will only traverse up to the max
  * depth and no ignore elements under that depth.
  *
  * This method shouldn't be called directly, use the walk() method instead.
  *
  * @see Walker::start_el()
  * @since 2.5.0
  *
  * @param object $element Data object
  * @param array $children_elements List of elements to continue traversing.
  * @param int $max_depth Max depth to traverse.
  * @param int $depth Depth of current element.
  * @param array $args
  * @param string $output Passed by reference. Used to append additional content.
  * @return null Null on failure with no changes to parameters.
  */
 public function display_element($element, &$children_elements, $max_depth, $depth, $args, &$output)
 {
     if (!$element) {
         return;
     }
     $id_field = $this->db_fields['id'];
     $this->has_children = !empty($children_elements[$element->{$id_field}]);
     parent::display_element($element, $children_elements, $max_depth, $depth, $args, $output);
 }
开发者ID:sinaru,项目名称:Educa,代码行数:29,代码来源:wp_bootstrap_navwalker.php

示例11: display_element

 function display_element($element, &$children_elements, $max_depth, $depth = 0, $args, &$output)
 {
     $id_field = $this->db_fields['id'];
     if (!empty($children_elements[$element->{$id_field}])) {
         $element->classes[] = 'haschild';
         $element->arrow = '<span class="menu-arrow"></span>';
     }
     Walker_Nav_Menu::display_element($element, $children_elements, $max_depth, $depth, $args, $output);
 }
开发者ID:rajveerbeniwal,项目名称:rooms-dhkh,代码行数:9,代码来源:custom_menu_helper.php

示例12:

 function display_element($element, &$children_elements, $max_depth, $depth = 0, $args, &$output)
 {
     $element->has_children = !empty($children_elements[$element->ID]);
     if (!empty($element->classes)) {
         $element->classes[] = $element->current || $element->current_item_ancestor ? 'active' : '';
         $element->classes[] = $element->has_children ? 'has-dropdown' : '';
     }
     parent::display_element($element, $children_elements, $max_depth, $depth, $args, $output);
 }
开发者ID:msfarias,项目名称:mandesfiha,代码行数:9,代码来源:wp_fundation_navwalker.php

示例13: display_element

 function display_element($element, &$children_elements, $max_depth, $depth = 0, $args, &$output)
 {
     $id_field = $this->db_fields['id'];
     if (!empty($children_elements[$element->{$id_field}])) {
         $element->classes[] = 'has_children has-children';
         wp_enqueue_style('cpotheme-fontawesome');
     }
     Walker_Nav_Menu::display_element($element, $children_elements, $max_depth, $depth, $args, $output);
 }
开发者ID:obecolette,项目名称:wordpress,代码行数:9,代码来源:class_menu.php

示例14: display_element

 function display_element($element, &$children_elements, $max_depth, $depth = 0, $args, &$output)
 {
     $id_field = $this->db_fields['id'];
     // check whether there are children for the given ID
     $element->hasChildren = isset($children_elements[$element->{$id_field}]) && !empty($children_elements[$element->{$id_field}]);
     if (!empty($children_elements[$element->{$id_field}])) {
         $element->classes[] = 'menu-item-parent';
     }
     Walker_Nav_Menu::display_element($element, $children_elements, $max_depth, $depth, $args, $output);
 }
开发者ID:damiansu,项目名称:wordpress-es,代码行数:10,代码来源:Bw_megamenu_walker.php

示例15:

 function display_element($element, &$children_elements, $max_depth, $depth = 0, $args, &$output)
 {
     if (!$element) {
         return;
     }
     $id_field = $this->db_fields['id'];
     if (!empty($children_elements[$element->{$id_field}])) {
         array_push($element->classes, 'has_sublevel');
     }
     parent::display_element($element, $children_elements, $max_depth, $depth, $args, $output);
 }
开发者ID:sergirams,项目名称:puentes_humanos,代码行数:11,代码来源:menu.php


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