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


PHP Vc_Grid_Item::setGridAttributes方法代码示例

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


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

示例1: render

 public function render()
 {
     $this->post_id = vc_request_param('post_id');
     $this->shortcodes_string = stripslashes(vc_request_param('shortcodes_string', true));
     require_once vc_path_dir('PARAMS_DIR', 'vc_grid_item/class-vc-grid-item.php');
     $grid_item = new Vc_Grid_Item();
     $grid_item->setIsEnd(false);
     $grid_item->setGridAttributes(array('element_width' => 4));
     $grid_item->setTemplate($this->shortcodes_string, $this->post_id);
     $this->enqueue();
     vc_include_template('params/vc_grid_item/preview.tpl.php', array('preview' => $this, 'grid_item' => $grid_item, 'shortcodes_string' => $this->shortcodes_string, 'post' => $this->mockingPost(), 'default_width_value' => apply_filters('vc_grid_item_preview_render_default_width_value', 4)));
 }
开发者ID:Junaid-Farid,项目名称:gocnex,代码行数:12,代码来源:class-vc-grid-item-preview.php

示例2: setItemsIfEmpty

 public function setItemsIfEmpty($items)
 {
     if (empty($items)) {
         require_once vc_path_dir('PARAMS_DIR', 'vc_grid_item/class-vc-grid-item.php');
         $grid_item = new Vc_Grid_Item();
         $grid_item->setGridAttributes($this->atts);
         $grid_item->shortcodes();
         $item = '[vc_gitem]<img src="' . vc_asset_url('vc/vc_gitem_image.png') . '">[/vc_gitem]';
         $grid_item->parseTemplate($item);
         $items = str_repeat($grid_item->renderItem(get_post((int) vc_request_param('vc_post_id'))), 3);
     }
     return $items;
 }
开发者ID:Sibzsolutions,项目名称:Schiffrinpa,代码行数:13,代码来源:vc-media-grid.php

示例3: renderItems

 private function renderItems()
 {
     $output = $items = '';
     $this->buildGridSettings();
     $css_classes = 'vc_row vc_clearfix vc_grid' . esc_attr($this->atts['gap'] > 0 ? ' vc_grid-gutter-' . (int) $this->atts['gap'] . 'px' : '');
     if (is_array($this->items) && !empty($this->items)) {
         require_once vc_path_dir('PARAMS_DIR', 'vc_grid_item/class-vc-grid-item.php');
         $grid_item = new Vc_Grid_Item();
         $grid_item->setGridAttributes($this->atts);
         $grid_item->setIsEnd(isset($this->is_end) && $this->is_end);
         $grid_item->setTemplateById($this->atts['item']);
         $output .= $grid_item->addShortcodesCustomCss();
         ob_start();
         wp_print_styles();
         $output .= ob_get_clean();
         $output .= vc_get_template('shortcodes/vc_basic_grid_filter.php', array('filter_terms' => $this->filter_terms, 'atts' => $this->atts));
         while (have_posts()) {
             the_post();
             $items .= $grid_item->renderItem(get_post());
         }
         /*
         foreach ( $this->items as $post ) {
         	$post->the_post();
         	$items .= $grid_item->renderItem( $post );
         
         	$items .= trim( vc_get_template( 'shortcodes/vc_grid_item.php', array(
         		'post' => $post,
         		'element_width' => $this->atts['element_width'],
         	) ) );
         */
     }
     $items = apply_filters($this->shortcode . '_items_list', $items);
     $output .= $this->renderPagination($this->atts['style'], $this->grid_settings, $items, $css_classes) . "\n";
     return $output;
 }
开发者ID:rovak73,项目名称:sinfronterasdoc,代码行数:35,代码来源:vc-basic-grid.php

示例4: renderItems

 private function renderItems()
 {
     $output = $items = '';
     $this->buildGridSettings();
     $atts = $this->atts;
     $settings = $this->grid_settings;
     $filter_terms = $this->filter_terms;
     $is_end = isset($this->is_end) && $this->is_end;
     $css_classes = 'vc_grid vc_row' . esc_attr($atts['gap'] > 0 ? ' vc_grid-gutter-' . (int) $atts['gap'] . 'px' : '');
     if (is_array($this->items) && !empty($this->items)) {
         require_once vc_path_dir('PARAMS_DIR', 'vc_grid_item/class-vc-grid-item.php');
         $grid_item = new Vc_Grid_Item();
         $grid_item->setGridAttributes($atts);
         $grid_item->setIsEnd($is_end);
         $grid_item->setTemplateById($atts['item']);
         $output .= $grid_item->addShortcodesCustomCss();
         ob_start();
         wp_print_styles();
         $output .= ob_get_clean();
         $attributes = array('filter_terms' => $filter_terms, 'atts' => $atts, 'grid_item', $grid_item);
         $output .= apply_filters('vc_basic_grid_template_filter', vc_get_template('shortcodes/vc_basic_grid_filter.php', $attributes), $attributes);
         while (have_posts()) {
             the_post();
             $items .= $grid_item->renderItem(get_post());
         }
         wp_reset_postdata();
     }
     $items = apply_filters($this->shortcode . '_items_list', $items);
     $output .= $this->renderPagination($atts['style'], $settings, $items, $css_classes);
     return $output;
 }
开发者ID:pab44,项目名称:pab44,代码行数:31,代码来源:vc-basic-grid.php


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