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


PHP ShortcodeHelper::find_tree_item方法代码示例

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


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

示例1: shortcode_handler_prepare

 /**
  * function that sets some internal variables and counters, then calls the actual shortcode handling function
  */
 public function shortcode_handler_prepare($atts, $content = "", $shortcodename = "", $fake = false)
 {
     $meta = array();
     if (empty($this->config['inline'])) {
         $meta = array('el_class' => " avia-builder-el-" . ShortcodeHelper::$shortcode_index . " ", 'index' => ShortcodeHelper::$shortcode_index, 'this' => ShortcodeHelper::find_tree_item(ShortcodeHelper::$shortcode_index), 'siblings' => array('next' => ShortcodeHelper::find_tree_item(ShortcodeHelper::$shortcode_index, 1), 'prev' => ShortcodeHelper::find_tree_item(ShortcodeHelper::$shortcode_index, -1)));
         if (!empty($meta['siblings']['prev']['tag'])) {
             $meta['el_class'] .= " el_after_" . $meta['siblings']['prev']['tag'] . " ";
         }
         if (!empty($meta['siblings']['next']['tag'])) {
             $meta['el_class'] .= " el_before_" . $meta['siblings']['next']['tag'] . " ";
         }
         $fullwidth = AviaBuilder::$full_el;
         if (!empty($meta['this']['tag']) && !in_array($meta['this']['tag'], $fullwidth)) {
             if (!empty($meta['siblings']['next']['tag']) && in_array($meta['siblings']['next']['tag'], $fullwidth)) {
                 $meta['siblings']['next'] = false;
             }
             if (!empty($meta['siblings']['prev']['tag']) && in_array($meta['siblings']['prev']['tag'], $fullwidth)) {
                 $meta['siblings']['prev'] = false;
             }
         }
         //single element without siblings
         if (empty($meta['siblings']['next']) && empty($meta['siblings']['prev'])) {
             $meta['el_class'] .= " avia-builder-el-no-sibling ";
         } else {
             if (empty($meta['siblings']['next'])) {
                 $meta['el_class'] .= " avia-builder-el-last ";
             } else {
                 if (empty($meta['siblings']['prev'])) {
                     $meta['el_class'] .= " avia-builder-el-first ";
                 }
             }
         }
         //if the shortcode was added without beeing a builder element (eg button within layerslider) reset all styles for that shortcode and make sure it is marked as a fake element
         if (empty($meta['this']['tag']) || $shortcodename != $meta['this']['tag']) {
             $fake = true;
             $meta = array('el_class' => '');
         }
         //fake is set when we manually call one shortcode inside another
         if (!$fake) {
             ShortcodeHelper::$shortcode_index++;
         }
     }
     if (isset($atts['custom_class'])) {
         $meta['el_class'] .= " " . $atts['custom_class'];
         $meta['custom_class'] = $atts['custom_class'];
     }
     $content = $this->shortcode_handler($atts, $content, $shortcodename, $meta);
     return $content;
 }
开发者ID:Jiersone,项目名称:mac,代码行数:52,代码来源:shortcode-template.class.php


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