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


PHP Essential_Grid_Base::text_has_certain_tag方法代码示例

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


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

示例1: insert_layer


//.........这里部分代码省略.........
                                 break;
                             case 'post-content':
                                 if ($is_post) {
                                     $ajax_attr = ' data-ajaxtype="postid"';
                                     // postid, html5vid youtubeid vimeoid soundcloud revslider
                                     $ajax_attr .= ' data-ajaxsource="' . @$this->post['ID'] . '"';
                                     //depending on type
                                 } else {
                                     $do_continue = true;
                                     //$ajax_class = '';
                                 }
                                 break;
                             case 'featured-image':
                             case 'alternate-image':
                             case 'content-image':
                                 $img_url = '';
                                 if ($order == 'content-image') {
                                     $img_url = $this->media_sources[$order];
                                 } else {
                                     $img_url = $this->media_sources[$order . '-full'];
                                 }
                                 $ajax_attr = ' data-ajaxtype="imageurl"';
                                 // postid, html5vid youtubeid vimeoid soundcloud revslider
                                 $ajax_attr .= ' data-ajaxsource="' . $img_url . '"';
                                 //depending on type
                                 break;
                             default:
                                 $ajax_class = '';
                                 $do_continue = true;
                                 break;
                         }
                         if ($do_continue) {
                             continue;
                         }
                         break;
                     } else {
                         //some custom entry maybe
                         $postobj = $is_post ? $this->post : false;
                         $ajax_attr = apply_filters('essgrid_handle_ajax_content', $order, $this->media_sources, $postobj, $this->grid_id);
                         if (empty($ajax_attr)) {
                             //$ajax_class = '';
                             $do_continue = true;
                         }
                         if ($do_continue) {
                             continue;
                         }
                         break;
                     }
                 }
             }
             //$ajax_attr .= ' data-ajaxcallback=""'; //functionname
             //$ajax_attr .= ' data-ajaxcsstoload=""'; //css source
             //$ajax_attr .= ' data-ajaxjstoload=""'; //js source
             if ($ajax_class !== '') {
                 //set ajax loading to true so that the grid can decide to put ajax container in top/bottom
                 $this->ajax_loading = true;
             }
             break;
     }
     if ($link_to !== 'none') {
         $do_display = true;
     }
     //set back to true if a link is set on layer
     $text = trim($text);
     //check for special styling coming from post option and set css to the queue
     $this->set_meta_element_changes($layer['id'], $unique_class);
     $post_class = !isset($post['ID']) ? '' : ' eg-post-' . $post['ID'];
     if ($base->text_has_certain_tag($text, 'a') && !$do_ignore_styles) {
         //check if a tag exists, if yes, class will be set to a tags and not the wrapping div, also the div will receive the position and other stylings // && @$layer['settings']['source'] !== 'text'
         if ($is_woo_cats && strpos($text, 'class="') !== false || $is_woo_button || $is_filter_cat && strpos($text, 'class="') !== false) {
             //add to the classes instead of creating own class attribute if it is woocommerce cats AND a class can be found
             $text = str_replace('class="', 'class="' . $unique_class . $post_class . $lb_class . ' ', $text);
         } elseif ($is_html_source && strpos($text, 'class="') !== false) {
             $text = str_replace('<a', '<a class="' . $unique_class . $post_class . $lb_class . '"', $text);
         } else {
             $text = str_replace('<a', '<a class="' . $unique_class . $post_class . $lb_class . '"', $text);
         }
         //moved to more global css generation process @version: 2.0
         //$this->add_css_wrap[$unique_class]['a']['display'] = $do_display; //do_display defines if we should write display: block;
         //$this->add_css_wrap[$unique_class]['a']['full'] = $do_full; //do full styles (for categories and tags separator)
         $unique_class .= '-a';
     }
     if ($do_ignore_styles) {
         $unique_class = 'eg-' . esc_attr($this->handle) . '-nostyle-element-' . $layer['id'];
     }
     //replace all the normal shortcodes
     $text = do_shortcode($text);
     if ($special_item == 'true' && $special_item_type == 'line-break') {
         //line break element
         echo '              <div class="esg-' . $class . ' ' . $unique_class . ' esg-none esg-clear" style="height: 5px; visibility: hidden;"></div>' . "\n";
     } elseif (trim($text) !== '') {
         //}elseif(!empty($text)){
         $use_tag = $base->getVar($layer['settings'], 'tag-type', 'div');
         echo '				<' . $use_tag . ' class="esg-' . $class . $post_class . $video_play . $ajax_class . ' ' . $hideunderClass . $unique_class . $transition . '"' . $ajax_attr . $transition_split . $delay . $hideunderHTML;
         echo $demo == 'custom' ? $demo_element_type : '';
         echo '>';
         echo $text;
         echo '</' . $use_tag . '>' . "\n";
     }
 }
开发者ID:NgocSon2412,项目名称:website_banhang,代码行数:101,代码来源:item-skin.class.php


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