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


PHP vc_sorted_list_parse_value函数代码示例

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


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

示例1: array

global $vc_teaser_box;
$posts_query = $el_class = $args = $my_query = $speed = $mode = $swiper_options = '';
$content = $link = $layout = $thumb_size = $link_target = $slides_per_view = $wrap = '';
$autoplay = $hide_pagination_control = $hide_prev_next_buttons = $title = '';
$posts = array();
extract(shortcode_atts(array('el_class' => '', 'posts_query' => '', 'mode' => 'horizontal', 'speed' => '5000', 'slides_per_view' => '1', 'swiper_options' => '', 'wrap' => '', 'autoplay' => 'no', 'hide_pagination_control' => '', 'hide_prev_next_buttons' => '', 'layout' => 'title,thumbnail,excerpt', 'link_target' => '', 'thumb_size' => 'thumbnail', 'partial_view' => '', 'title' => ''), $atts));
global $vc_posts_grid_exclude_id;
$vc_posts_grid_exclude_id[] = get_the_ID();
// fix recursive nesting
if (is_array($posts_query)) {
    $posts_query['post_status'] = 'publish';
} else {
    $posts_query .= '|post_status:publish';
}
list($args, $my_query) = vc_build_loop_query($posts_query, get_the_ID());
$teaser_blocks = vc_sorted_list_parse_value($layout);
/** @var $my_query WP_Query */
while ($my_query->have_posts()) {
    $my_query->the_post();
    // Get post from query
    if (in_array(get_the_ID(), $vc_posts_grid_exclude_id)) {
        continue;
    }
    $post = new stdClass();
    // Creating post object.
    $post->id = get_the_ID();
    $post->link = get_permalink($post->id);
    $post->post_type = get_post_type();
    if ($vc_teaser_box->getTeaserData('enable', $post->id) === '1') {
        $post->custom_user_teaser = true;
        $data = $vc_teaser_box->getTeaserData('data', $post->id);
开发者ID:chicosilva,项目名称:olharambiental,代码行数:31,代码来源:vc_carousel.php

示例2: uncode_flatArray

         $typeLayout = $post_blocks;
         break;
     case 'page':
         $typeLayout = $page_blocks;
         break;
     case 'portfolio':
         $typeLayout = $portfolio_blocks;
         break;
     case 'product':
         $typeLayout = $product_blocks;
         $block_data['product'] = true;
         $block_classes[] = 'tmb-woocommerce';
         break;
 }
 if (isset($item_prop['single_layout'])) {
     $typeLayout = uncode_flatArray(vc_sorted_list_parse_value($item_prop['single_layout']));
 }
 $single_text = isset($item_prop['single_text']) ? $item_prop['single_text'] : $general_text;
 if ($index_type !== 'carousel') {
     $single_width = isset($item_prop['single_width']) ? $item_prop['single_width'] : $general_width;
     $block_classes[] = 'tmb-iso-w' . $single_width;
 } else {
     $single_width = 12 / $carousel_lg;
 }
 $single_height = isset($item_prop['single_height']) ? $item_prop['single_height'] : $general_height;
 $block_classes[] = 'tmb-iso-h' . $single_height;
 $images_size = isset($item_prop['images_size']) ? $item_prop['images_size'] : $general_images_size;
 $single_back_color = isset($item_prop['single_back_color']) ? $item_prop['single_back_color'] : $general_back_color;
 //$single_no_background = (isset($item_prop['single_no_background'])) ? $item_prop['single_no_background'] : $general_no_background;
 $single_shape = isset($item_prop['single_shape']) ? $item_prop['single_shape'] : $general_shape;
 if ($single_shape !== '') {
开发者ID:b0123498765,项目名称:fithealthyandwealthy,代码行数:31,代码来源:uncode_index.php

示例3: uncode_flatArray

    }
    if ($lbox_deep !== '') {
        $lightbox_classes['data-deep'] = $media;
    }
    if ($lbox_no_tmb !== '') {
        $lightbox_classes['data-notmb'] = true;
    }
    if ($lbox_no_arrows !== '') {
        $lightbox_classes['data-noarr'] = true;
    }
    if (count($lightbox_classes) === 0) {
        $lightbox_classes['data-active'] = true;
    }
}
if ($advanced === 'yes') {
    $layout = uncode_flatArray(vc_sorted_list_parse_value($media_items));
    if ($media_lightbox !== 'yes') {
        $lightbox_classes = array();
        if (!isset($media_link['url']) || $media_link['url'] === '') {
            $block_data['link_class'] = 'inactive-link';
            $block_data['link'] = '#';
        } else {
            if ($media_link !== '') {
                $block_data['link']['url'] = $a_href;
                $block_data['link']['target'] = $a_target;
            }
        }
    }
    if (isset($layout['media'][0]) && $layout['media'][0] === 'poster') {
        $block_data['poster'] = true;
    }
开发者ID:b0123498765,项目名称:fithealthyandwealthy,代码行数:31,代码来源:vc_single_image.php

示例4: render

        public function render($atts, $content = null)
        {
            global $vc_teaser_box;
            $grid_link = $grid_layout_mode = $title = $filter = $shows_date_class = '';
            $posts = array();
            extract(shortcode_atts(array('title' => '', 'grid_columns_count' => 4, 'grid_teasers_count' => 8, 'grid_layout' => 'title,thumbnail,text', 'grid_link_target' => '_self', 'filter' => '', 'grid_thumb_size' => 'thumbnail', 'grid_layout_mode' => 'fitRows', 'el_class' => '', 'teaser_width' => '12', 'orderby' => null, 'order' => 'DESC', 'loop' => '', 'date_format' => 'M j, Y'), $atts));
            $this->resetTaxonomies();
            if (empty($loop)) {
                return;
            }
            $this->getLoop($loop);
            $my_query = $this->query;
            $args = $this->loop_args;
            $teaser_blocks = vc_sorted_list_parse_value($grid_layout);
            while ($my_query->have_posts()) {
                $my_query->the_post();
                // Get post from query
                $post = new stdClass();
                // Creating post object.
                $post->id = get_the_ID();
                $post->link = get_permalink($post->id);
                if ($vc_teaser_box->getTeaserData('enable', $post->id) === '1') {
                    $post->custom_user_teaser = true;
                    $data = $vc_teaser_box->getTeaserData('data', $post->id);
                    if (!empty($data)) {
                        $data = json_decode($data);
                    }
                    $post->bgcolor = $vc_teaser_box->getTeaserData('bgcolor', $post->id);
                    $post->custom_teaser_blocks = array();
                    $post->title_attribute = the_title_attribute('echo=0');
                    if (!empty($data)) {
                        foreach ($data as $block) {
                            $settings = array();
                            if ($block->name === 'title') {
                                $post->title = the_title("", "", false);
                            } elseif ($block->name === 'image') {
                                if ($block->image === 'featured') {
                                    $post->thumbnail_data = $this->getPostThumbnail($post->id, $grid_thumb_size);
                                } elseif (!empty($block->image)) {
                                    $post->thumbnail_data = wpb_getImageBySize(array('attach_id' => (int) $block->image, 'thumb_size' => $grid_thumb_size));
                                } else {
                                    $post->thumbnail_data = false;
                                }
                                $post->thumbnail = $post->thumbnail_data && isset($post->thumbnail_data['thumbnail']) ? $post->thumbnail_data['thumbnail'] : '';
                                $post->image_link = empty($video) && $post->thumbnail && isset($post->thumbnail_data['p_img_large'][0]) ? $post->thumbnail_data['p_img_large'][0] : $video;
                            } elseif ($block->name === 'text') {
                                if ($block->mode === 'custom') {
                                    $settings[] = 'text';
                                    $post->content = $block->text;
                                } elseif ($block->mode === 'excerpt') {
                                    $settings[] = $block->mode;
                                    $post->excerpt = $this->getPostExcerpt();
                                } else {
                                    $settings[] = $block->mode;
                                    $post->content = $this->getPostContent();
                                }
                            }
                            if (isset($block->link)) {
                                if ($block->link === 'post') {
                                    $settings[] = 'link_post';
                                } elseif ($block->link === 'big_image') {
                                    $settings[] = 'link_image';
                                } else {
                                    $settings[] = 'no_link';
                                }
                                $settings[] = '';
                            }
                            $post->custom_teaser_blocks[] = array($block->name, $settings);
                        }
                    }
                } else {
                    $post->custom_user_teaser = false;
                    $post->title = the_title("", "", false);
                    $post->title_attribute = the_title_attribute('echo=0');
                    $post->post_type = get_post_type();
                    $post->content = $this->getPostContent();
                    $post->excerpt = $this->getPostExcerpt();
                    $post->thumbnail_data = $this->getPostThumbnail($post->id, $grid_thumb_size);
                    $post->thumbnail = $post->thumbnail_data && isset($post->thumbnail_data['thumbnail']) ? $post->thumbnail_data['thumbnail'] : '';
                    $video = get_post_meta($post->id, "_p_video", true);
                    $post->imae_link = empty($video) && $post->thumbnail && isset($post->thumbnail_data['p_img_large'][0]) ? $post->thumbnail_data['p_img_large'][0] : $video;
                    $post->comment_count = get_comments_number($post->id);
                    $posttags = get_the_tags($post->id);
                    $tags = '';
                    if ($posttags) {
                        foreach ($posttags as $tag) {
                            $tags .= '<a href="' . get_tag_link($tag->term_id) . '">' . $tag->name . '</a> ';
                        }
                        $tags .= ' |';
                    }
                    $post->tags = $tags;
                }
                $post->categories_css = $this->getCategoriesCss($post->id);
                $posts[] = $post;
            }
            wp_reset_query();
            /**
             * Css classes for grid and teasers.
             * {{
             */
//.........这里部分代码省略.........
开发者ID:selinaross,项目名称:spring-ridge,代码行数:101,代码来源:posts-grid-custom.php


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