• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Vc_Grid_Item类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了Vc_Grid_Item类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: vc_grid_item_render_preview

/**
 *  Render preview for grid item
 * @since 4.4
 */
function vc_grid_item_render_preview()
{
    require_once vc_path_dir('PARAMS_DIR', 'vc_grid_item/class-vc-grid-item.php');
    $grid_item = new Vc_Grid_Item();
    $grid_item->mapShortcodes();
    require_once vc_path_dir('PARAMS_DIR', 'vc_grid_item/editor/class-vc-grid-item-preview.php');
    $vcGridPreview = new Vc_Grid_Item_Preview();
    add_filter('vc_gitem_template_attribute_post_image_background_image_css_value', array($vcGridPreview, 'addCssBackgroundImage'));
    add_filter('vc_gitem_template_attribute_post_image_url_value', array($vcGridPreview, 'addImageUrl'));
    $vcGridPreview->render();
    die;
}
开发者ID:rovak73,项目名称:sinfronterasdoc,代码行数:16,代码来源:vc-grid-item-editor.php


示例3: 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


示例4: vc_vc_grid_item_form_field

function vc_vc_grid_item_form_field($settings, $value)
{
    require_once vc_path_dir('PARAMS_DIR', 'vc_grid_item/editor/class-vc-grid-item-editor.php');
    require_once vc_path_dir('PARAMS_DIR', 'vc_grid_item/class-vc-grid-item.php');
    $output = '<div data-vc-grid-element="container">' . '<select data-vc-grid-element="value" type="hidden" name="' . $settings['param_name'] . '" class="wpb_vc_param_value wpb-select ' . $settings['param_name'] . ' ' . $settings['type'] . '_field" ' . '>';
    $vc_grid_item_templates = Vc_Grid_Item::predefinedTemplates();
    if (is_array($vc_grid_item_templates)) {
        foreach ($vc_grid_item_templates as $key => $data) {
            $output .= '<option data-vc-link="' . esc_url(admin_url('post-new.php?post_type=vc_grid_item&vc_gitem_template=' . $key)) . '" value="' . $key . '"' . ($key === $value ? ' selected="true"' : '') . '>' . esc_html($data['name']) . '</option>';
        }
    }
    $grid_item_posts = get_posts(array('posts_per_page' => '-1', 'orderby' => 'post_title', 'post_type' => Vc_Grid_Item_Editor::postType()));
    foreach ($grid_item_posts as $post) {
        $output .= '<option  data-vc-link="' . esc_url(get_edit_post_link($post->ID)) . '"value="' . $post->ID . '"' . ((string) $post->ID === $value ? ' selected="true"' : '') . '>' . esc_html($post->post_title) . '</option>';
    }
    $output .= '</select></div>';
    return $output;
}
开发者ID:Angelpm28,项目名称:ong-canada,代码行数:18,代码来源:vc_grid_item.php


示例5: 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


示例6: vc_gitem_content_shortcodes

function vc_gitem_content_shortcodes()
{
    require_once vc_path_dir('PARAMS_DIR', 'vc_grid_item/class-vc-grid-item.php');
    $grid_item = new Vc_Grid_Item();
    $invalid_shortcodes = apply_filters('vc_gitem_zone_grid_item_not_content_shortcodes', array('vc_gitem', 'vc_gitem_animated_block', 'vc_gitem_zone', 'vc_gitem_zone_a', 'vc_gitem_zone_b', 'vc_gitem_zone_c', 'vc_gitem_row', 'vc_gitem_col'));
    return array_diff(array_keys($grid_item->shortcodes()), $invalid_shortcodes);
}
开发者ID:RDePoppe,项目名称:luminaterealestate,代码行数:7,代码来源:vc-grid-item-editor.php


示例7: getGridTemplates

 public function getGridTemplates()
 {
     $list = Vc_Grid_Item::predefinedTemplates();
     return $list;
 }
开发者ID:severnrescue,项目名称:web,代码行数:5,代码来源:class-vc-templates-editor-grid-item.php


示例8: die

<?php

if (!defined('ABSPATH')) {
    die('-1');
}
require_once vc_path_dir('PARAMS_DIR', 'vc_grid_item/editor/popups/class-vc-add-element-box-grid-item.php');
$add_element_box = new Vc_Add_Element_Box_Grid_Item();
$add_element_box->render();
// Edit form for mapped shortcode.
visual_composer()->editForm()->render();
require_once vc_path_dir('PARAMS_DIR', 'vc_grid_item/editor/popups/class-vc-templates-editor-grid-item.php');
$templates_editor = new Vc_Templates_Editor_Grid_Item();
$templates_editor->renderUITemplate();
$grid_item = new Vc_Grid_Item();
$shortcodes = $grid_item->shortcodes();
if (vc_user_access()->part('presets')->can()->get()) {
    require_once vc_path_dir('AUTOLOAD_DIR', 'class-vc-settings-presets.php');
    $vc_settings_presets = Vc_Settings_Preset::listDefaultSettingsPresets();
    $vc_vendor_settings_presets = Vc_Settings_Preset::listDefaultVendorSettingsPresets();
} else {
    $vc_settings_presets = array();
    $vc_vendor_settings_presets = array();
}
?>
	<script type="text/javascript">
		var vc_user_mapper = <?php 
echo json_encode(WpbMap_Grid_Item::getGitemUserShortCodes());
?>
,
			vc_mapper = <?php 
echo json_encode(WpbMap_Grid_Item::getShortCodes());
开发者ID:domalexxx,项目名称:nashvancouver,代码行数:31,代码来源:vc_grid_item_editor_footer.tpl.php


示例9: _e

<input type="hidden" id="wpb_vc_js_status" name="wpb_vc_js_status" value="true"/>
<input type="hidden" id="wpb_vc_loading" name="wpb_vc_loading"
       value="<?php 
_e('Loading, please wait...', 'js_composer');
?>
"/>
<input type="hidden" id="wpb_vc_loading_row" name="wpb_vc_loading_row"
       value="<?php 
_e('Crunching...', 'js_composer');
?>
"/>
<input type="hidden" name="vc_grid_item_editor" value="true"/>
<script type="text/javascript">
	<?php 
$vc_gitem_template = vc_request_param('vc_gitem_template');
if (strlen($vc_gitem_template) && false !== ($template = Vc_Grid_Item::predefinedTemplate($vc_gitem_template))) {
    echo "var vcDefaultGridItemContent = '" . $template['template'] . "';";
} else {
    ?>
	/**
	 * Get content of grid item editor of current post. Data is used as models collection of shortcodes.
	 * Data always wrapped with vc_gitem shortcode.
	 * @return {*}
	 */
	var vcDefaultGridItemContent = '' +
		'[vc_gitem]' +
		'[vc_gitem_animated_block]' +
		'[vc_gitem_zone_a]' +
		'[vc_gitem_row position="top"]' +
		'[vc_gitem_col width="1/1"][/vc_gitem_col]' +
		'[/vc_gitem_row]' +
开发者ID:severnrescue,项目名称:web,代码行数:31,代码来源:vc_grid_item_editor.tpl.php


示例10: 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


示例11: vc_path_dir

<?php

require_once vc_path_dir('PARAMS_DIR', 'vc_grid_item/editor/popups/class-vc-add-element-box-grid-item.php');
$add_element_box = new Vc_Add_Element_Box_Grid_Item();
$add_element_box->render();
// Edit form for mapped shortcode.
visual_composer()->editForm()->render();
require_once vc_path_dir('PARAMS_DIR', 'vc_grid_item/editor/popups/class-vc-templates-editor-grid-item.php');
$templates_editor = new Vc_Templates_Editor_Grid_Item();
$templates_editor->render();
require_once vc_path_dir('EDITORS_DIR', 'popups/class-vc-edit-layout.php');
$edit_layout = new Vc_Edit_Layout();
$edit_layout->render();
$grid_item = new Vc_Grid_Item();
$shortcodes = $grid_item->shortcodes();
$grid_item->mapShortcodes();
?>
<script type="text/javascript">
	var vc_user_mapper = <?php 
echo json_encode($shortcodes);
?>
,
		vc_mapper = <?php 
echo json_encode($shortcodes);
?>
,
		vc_frontend_enabled = false,
		vc_mode = '<?php 
echo vc_mode();
?>
';
开发者ID:chicosilva,项目名称:olharambiental,代码行数:31,代码来源:vc_grid_item_editor_footer.tpl.php


示例12: shortcodes

 /**
  * Get shortcodes from param type vc_grid_item
  * @return array|bool
  */
 public function shortcodes()
 {
     $grid_item = new Vc_Grid_Item();
     return $grid_item->shortcodes();
 }
开发者ID:chicosilva,项目名称:olharambiental,代码行数:9,代码来源:class-vc-add-element-box-grid-item.php


示例13: predefinedTemplates

 /**
  * Get list of predefined templates.
  *
  * @return bool|mixed
  */
 public static function predefinedTemplates()
 {
     if (false === self::$predefined_templates) {
         self::$predefined_templates = apply_filters('vc_grid_item_predefined_templates', include vc_path_dir('PARAMS_DIR', 'vc_grid_item/templates.php'));
     }
     return self::$predefined_templates;
 }
开发者ID:Angelpm28,项目名称:ong-canada,代码行数:12,代码来源:class-vc-grid-item.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Vehicle类代码示例发布时间:2022-05-23
下一篇:
PHP VcShortcodeAutoloader类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap