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


PHP vc_map_get_attributes函数代码示例

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


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

示例1: images_content

function images_content($atts, $content = null)
{
    $title = $description = $content_img = $img_size = $more = $align = $link = $css_animation = $animated = $animated_data = '';
    $atts = vc_map_get_attributes('images_content', $atts);
    extract($atts);
    $animated = $animated_data = '';
    if ($css_animation != '') {
        $animated = ' animated ';
        $animated_data = ' data-gen="' . $css_animation . '"';
    }
    $out = '';
    $out .= '<div class="content-image wpb_content_element ' . $align . $animated . '"' . $animated_data . '>';
    if ($img_size == '') {
        $img_size = 'full';
    }
    if (!empty($content_img) && $content_img != '') {
        $img_id = preg_replace('/[^\\d]/', '', $content_img);
        $img = wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => $img_size));
        $out .= '<div class="s_image">' . $img['thumbnail'] . '</div>';
    }
    $out .= '<div class="s_info">';
    if ($title != '') {
        $out .= '<h3>' . $title . '</h3>';
    }
    if ($description != '') {
        $out .= '<div class="desc">' . do_shortcode('[vc_column_text title=""]' . $description . '[/vc_column_text]') . '</div>';
    }
    if ($more != '') {
        $out .= '<div class="folio-more"><a href="' . $link . '"><span>' . $more . '</span></a></div>';
    }
    $out .= '</div>';
    $out .= '</div>';
    return $out;
}
开发者ID:devmoonshine,项目名称:development,代码行数:34,代码来源:vc_content_image.php

示例2: content

    protected function content($atts, $content = null)
    {
        $atts = function_exists('vc_map_get_attributes') ? vc_map_get_attributes('edo_vertical_menu', $atts) : $atts;
        $atts = shortcode_atts(array('title' => 'Categories', 'theme' => '', 'el_class' => '', 'css' => ''), $atts);
        extract($atts);
        $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, ' ', $this->settings['base'], $atts), 'extra' => $this->getExtraClass($el_class), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' '));
        $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass));
        ob_start();
        ?>
         <!-- Block vertical-menu -->
        <div class="<?php 
        echo esc_attr($theme);
        ?>
">
            <div class="block block-vertical-menu <?php 
        echo esc_attr($elementClass);
        ?>
 ">
                <div class="vertical-head">
                    <h5 class="vertical-title"><?php 
        echo $title;
        ?>
</h5>
                </div>
                <div class="vertical-menu-content">
                    <?php 
        wp_nav_menu(array('menu' => 'vertical-menu', 'theme_location' => 'vertical-menu', 'depth' => 2, 'container' => '', 'container_class' => '', 'container_id' => 'vertial-menu', 'menu_class' => 'vertical-menu-list', 'fallback_cb' => 'wp_bootstrap_navwalker::fallback', 'walker' => new wp_bootstrap_navwalker()));
        ?>
                </div>
            </div>
        </div>
        <!-- ./Block vertical-menu -->
        <?php 
        return ob_get_clean();
    }
开发者ID:ngocthangict,项目名称:edo,代码行数:35,代码来源:vertical-menu.php

示例3: getAttributes

 /**
  * Parses shortcode attributes and set defaults based on vc_map function relative to shortcode and fields names
  *
  * @param $atts
  *
  * @since 4.3
  * @return array
  */
 public function getAttributes($atts)
 {
     /**
      * Shortcode attributes
      * @var $text
      * @var $google_fonts
      * @var $font_container
      * @var $el_class
      * @var $link
      * @var $css
      */
     $atts = vc_map_get_attributes($this->getShortcode(), $atts);
     extract($atts);
     /**
      * Get default values from VC_MAP.
      **/
     $google_fonts_field = $this->getParamData('google_fonts');
     $font_container_field = $this->getParamData('font_container');
     $el_class = $this->getExtraClass($el_class);
     $font_container_obj = new Vc_Font_Container();
     $google_fonts_obj = new Vc_Google_Fonts();
     $font_container_field_settings = isset($font_container_field['settings'], $font_container_field['settings']['fields']) ? $font_container_field['settings']['fields'] : array();
     $google_fonts_field_settings = isset($google_fonts_field['settings'], $google_fonts_field['settings']['fields']) ? $google_fonts_field['settings']['fields'] : array();
     $font_container_data = $font_container_obj->_vc_font_container_parse_attributes($font_container_field_settings, $font_container);
     $google_fonts_data = strlen($google_fonts) > 0 ? $google_fonts_obj->_vc_google_fonts_parse_attributes($google_fonts_field_settings, $google_fonts) : '';
     return array('text' => isset($text) ? $text : '', 'google_fonts' => $google_fonts, 'font_container' => $font_container, 'el_class' => $el_class, 'css' => $css, 'link' => 0 === strpos($link, '|') ? false : $link, 'font_container_data' => $font_container_data, 'google_fonts_data' => $google_fonts_data);
 }
开发者ID:evanbuss,项目名称:wordpress,代码行数:35,代码来源:vc-custom-heading.php

示例4: gmap

function gmap($atts, $content = null)
{
    $atts = vc_map_get_attributes('gmap', $atts);
    extract($atts);
    if ($latitude == '') {
        $latitude = '-7.796873';
    }
    if ($longitude == '') {
        $longitude = '110.369180';
    }
    if ($size == '') {
        $size = 200;
    }
    if ($zoom == '') {
        $zoom = 14;
    }
    $out = '';
    wp_enqueue_script('gmap3');
    wp_enqueue_script('googleapis');
    $size = str_replace(array('px', ' '), array('', ''), $size);
    $out .= '<div class="gmaps_widget wpb_content_element">';
    $out .= '<div class="wpb_wrapper">';
    $out .= wpb_widget_title(array('title' => $title));
    $out .= '<div id="map" data-latitude="' . $latitude . '" data-longitude="' . $longitude . '" data-zoom="' . $zoom . '" data-height="' . $size . '"></div>';
    $out .= '</div>';
    $out .= '</div>';
    return $out;
}
开发者ID:devmoonshine,项目名称:development,代码行数:28,代码来源:vc_gmap3.php

示例5: cq_vc_fullscreenintro_func

 function cq_vc_fullscreenintro_func($atts, $content = null, $tag)
 {
     if (version_compare(WPB_VC_VERSION, "4.6") >= 0) {
         $atts = vc_map_get_attributes($tag, $atts);
         extract($atts);
     } else {
         extract(shortcode_atts(array('backgroundtype' => '', 'backgroundcolor' => '', 'image' => '', 'imagerepeat' => '', 'introtext' => '', 'texticon' => 'fa-chevron-down', 'textposition' => '', 'textcolor' => '', 'textsize' => '', 'textfamily' => '', 'textclickable' => '', 'scrollto' => '', 'scrolloffset' => '', 'scrollspeed' => '', 'containerheight' => '', 'extraclass' => ''), $atts));
     }
     wp_register_style('font-awesome', plugins_url('../faanimation/css/font-awesome.min.css', __FILE__));
     wp_enqueue_style('font-awesome');
     wp_register_style('vc-extensions-fullscreenintro-style', plugins_url('css/style.css', __FILE__));
     wp_enqueue_style('vc-extensions-fullscreenintro-style');
     wp_register_script('smooth-scroll', plugins_url('js/jquery.smooth-scroll.min.js', __FILE__), array("jquery"));
     wp_enqueue_script('smooth-scroll');
     wp_register_script('vc-extensions-fullscreenintro-script', plugins_url('js/init.min.js', __FILE__), array("jquery", "smooth-scroll"));
     wp_enqueue_script('vc-extensions-fullscreenintro-script');
     $i = -1;
     $content = wpb_js_remove_wpautop($content);
     // fix unclosed/unwanted paragraph tags in $content
     $image = wp_get_attachment_image_src(trim($image), 'full');
     $output = '';
     $output .= '<div class="cq-fullscreen-intro ' . $extraclass . '" data-backgroundtype="' . $backgroundtype . '" data-image="' . $image[0] . '" data-textcolor="' . $textcolor . '" data-textsize="' . $textsize . '" data-textfamily="' . $textfamily . '" data-backgroundcolor="' . $backgroundcolor . '" data-textposition="' . $textposition . '" data-textclickable="' . $textclickable . '" data-imagerepeat="' . $imagerepeat . '" data-containerheight="' . $containerheight . '" data-scrollto="' . htmlspecialchars($scrollto) . '" data-scrolloffset="' . $scrolloffset . '" data-scrollspeed="' . $scrollspeed . '">';
     // $output .= do_shortcode($content);
     $output .= '<span class="cq-intro-text"><span class="intro-text">' . $introtext . '</span><i class="fa ' . $texticon . '"></i></span>';
     $output .= '</div>';
     return $output;
 }
开发者ID:sopada85,项目名称:esquema-test,代码行数:27,代码来源:vc-extensions-fullscreenintro.php

示例6: counter

function counter($atts, $content = null)
{
    $atts = vc_map_get_attributes('counter', $atts);
    extract($atts);
    $out = $color = '';
    wp_enqueue_script('countTO');
    if ($colored == 'yes') {
        $color = 'colored';
    } else {
        $color = '';
    }
    $out .= '<div class="counter wpb_content_element">';
    $out .= '<div class="counter-value ' . $color . '">';
    if ($units_before != '') {
        $out .= '<span>' . $units_before . '</span>';
    }
    $out .= '<span class="display-value" data-to="' . $value . '"></span>';
    if ($units_after != '') {
        $out .= '<span>' . $units_after . '</span>';
    }
    $out .= '</div>';
    if ($title != '') {
        $out .= '<h5 class="counter-title">' . $title . '</h5>';
    }
    $out .= '</div>';
    return $out;
}
开发者ID:devmoonshine,项目名称:development,代码行数:27,代码来源:vc_counter.php

示例7: list_icon

function list_icon($atts, $content = null)
{
    $atts = vc_map_get_attributes('list_icon', $atts);
    extract($atts);
    $animated = $animated_data = $icon_list_color = '';
    if ($icon_color) {
        $icon_list_color = ' style="color:' . $icon_color . ';"';
    }
    if ($css_animation != '') {
        $animated = ' animated ';
        $animated_data = ' data-gen="' . $css_animation . '"';
    }
    $out = $li_icon = '';
    if ($icon == 'metrize') {
        $li_icon = 'icons-' . $icon_metrize;
        $icon_class = 'metrize';
    } else {
        $li_icon = 'fa-' . $icon_awesome;
        $icon_class = 'awesome';
    }
    $list_text_array = explode(",", $list_text);
    $out .= '<div class="list-icon wpb_content_element' . $animated . '"' . $animated_data . '>';
    $out .= '<ul>';
    foreach ($list_text_array as $text) {
        $out .= '<li><i class="' . $li_icon . '"' . $icon_list_color . '></i><span>' . $text . '</span></li>';
    }
    $out .= '</ul>';
    $out .= '</div>';
    return $out;
}
开发者ID:devmoonshine,项目名称:development,代码行数:30,代码来源:vc_list_icon.php

示例8: wolf_shortcode_images_gallery

 /**
  * Gallery shortcode
  *
  * Will overwrite the default gallery shortcode
  *
  * @param array $atts
  * @param string $content
  * @return string
  */
 function wolf_shortcode_images_gallery($atts, $content = null)
 {
     if (class_exists('Vc_Manager') && function_exists('vc_map_get_attributes')) {
         $atts = vc_map_get_attributes('wolf_images_gallery', $atts);
     }
     extract(shortcode_atts(array('ids' => '', 'layout' => 'simple', 'columns' => '3', 'size' => 'classic-thumb', 'link' => 'attachment', 'padding' => 'no', 'hover_effect' => 'default', 'orderby' => '', 'inline_style' => '', 'class' => ''), $atts));
     $images = explode(',', $ids);
     $size = 'thumbnail' == $size ? 'classic-thumb' : $size;
     $size = wolf_get_image_size($size);
     if (wolf_is_blog() || wolf_is_portfolio()) {
         $output = wolf_flexslider_gallery($images, $orderby);
     } else {
         if ('carousel_mosaic' == $layout || 'mosaic' == $layout) {
             $carousel = $layout == 'carousel_mosaic' ? true : false;
             $output = wolf_mosaic_gallery($images, $link, $hover_effect, $orderby, $carousel, $inline_style, $class);
         } elseif ('carousel_simple' == $layout) {
             $output = wolf_simple_carousel_gallery($images, $link, $size, $padding, $hover_effect, $orderby, $inline_style, $class);
         } elseif ('simple' == $layout) {
             $output = wolf_simple_gallery($images, $link, $size, $padding, $columns, $hover_effect, $orderby, $inline_style, $class);
         } elseif ('masonry' == $layout) {
             $output = wolf_albums_gallery($images, $orderby, $inline_style, $class);
         }
     }
     return $output;
 }
开发者ID:estrategasdigitales,项目名称:dictobas,代码行数:34,代码来源:shortcode-images-gallery.php

示例9: wolf_highlight_shortcode_text

 /**
  * Highlight text shortcode
  *
  * @param array $atts
  * @param array $content
  * @return string
  */
 function wolf_highlight_shortcode_text($atts, $content = null)
 {
     if (class_exists('Vc_Manager') && function_exists('vc_map_get_attributes')) {
         $atts = vc_map_get_attributes('wolf_highlight_text', $atts);
     }
     return '<span class="wolf-highlight-' . $atts['color'] . '">' . $content . '</span>';
 }
开发者ID:estrategasdigitales,项目名称:dictobas,代码行数:14,代码来源:shortcode-highlight.php

示例10: cq_vc_pagetransition_func

 function cq_vc_pagetransition_func($atts, $content = null, $tag)
 {
     if (version_compare(WPB_VC_VERSION, "4.6") >= 0) {
         $atts = vc_map_get_attributes($tag, $atts);
         extract($atts);
     } else {
         extract(shortcode_atts(array('animationmode' => 'normal', 'pagein' => 'fade-in', 'pageout' => 'fade-out', 'overlayin' => 'overlay-slide-in-top', 'overlayout' => 'overlay-slide-out-top', 'pageinspeed' => '1500', 'pageoutspeed' => '800', 'linkelement' => '', 'isdisplay' => 'yes', 'sitewrapper' => '', 'overlaycolor' => ''), $atts));
     }
     $i = -1;
     $content = wpb_js_remove_wpautop($content);
     // fix unclosed/unwanted paragraph tags in $content
     // if($animationmode=="normal"&&$pagein!="zoom-in"){
     //   $pagein_arr = Array("fade-in", "fade-in-up-sm", "fade-in-up", "fade-in-up-lg", "fade-in-down-sm", "fade-in-down", "fade-in-down-lg", "fade-in-left-sm", "fade-in-left", "fade-in-left-lg", "fade-in-right-sm", "fade-in-right", "fade-in-right-lg", "rotate-in-sm", "rotate-in", "rotate-in-lg", "flip-in-x-fr", "flip-in-x", "flip-in-x-nr", "flip-in-y-fr", "flip-in-y", "flip-in-y-nr", "zoom-in-sm", "zoom-in", "zoom-in-lg");
     //   $pagein = $pagein_arr[array_rand($pagein_arr)];
     // }
     $output = '';
     if ($isdisplay != "no") {
         // wp_register_style('vc-extensions-pagetransition-style', plugins_url('css/style.css', __FILE__));
         // wp_enqueue_style('vc-extensions-pagetransition-style');
         wp_register_style('animsition', plugins_url('css/animsition.min.css', __FILE__));
         wp_enqueue_style('animsition');
         wp_register_script('animsition', plugins_url('js/jquery.animsition.min.js', __FILE__), array("jquery"));
         wp_enqueue_script('animsition');
         wp_register_script('vc-extensions-pagetransition-script', plugins_url('js/init.min.js', __FILE__), array("jquery"));
         wp_enqueue_script('vc-extensions-pagetransition-script');
         $output .= '<div class="cq-animsition" data-animationmode="' . $animationmode . '" data-pagein="' . $pagein . '" data-pageout="' . $pageout . '" data-overlayin="' . $overlayin . '" data-overlayout="' . $overlayout . '" data-pageinspeed="' . $pageinspeed . '" data-pageoutspeed="' . $pageoutspeed . '" data-linkelement="' . $linkelement . '" data-overlaycolor="' . $overlaycolor . '" data-sitewrapper="' . $sitewrapper . '">';
         $output .= '</div>';
     }
     return $output;
 }
开发者ID:sopada85,项目名称:esquema-test,代码行数:30,代码来源:vc-extensions-pagetransition.php

示例11: cq_vc_cqbutton_func

 function cq_vc_cqbutton_func($atts, $content = null, $tag)
 {
     if (version_compare(WPB_VC_VERSION, "4.6") >= 0) {
         $atts = vc_map_get_attributes($tag, $atts);
         extract($atts);
     } else {
         extract(shortcode_atts(array('buttonlabel' => '', 'link' => '', 'buttoncolor' => '', 'buttonbackground' => '', 'containerwidth' => '', 'animationstyle' => 'animatetype-1', 'iconbuttoncolor' => 'cqbtn-1', 'iconposition' => '', 'icon' => '', 'icontop' => '', 'iconleft' => '', 'mobilewidth' => '', 'onclick' => '', 'extra_class' => ''), $atts));
     }
     wp_register_style('vc_cqbutton_cq_style', plugins_url('css/style.min.css', __FILE__));
     wp_enqueue_style('vc_cqbutton_cq_style');
     wp_register_style('font-awesome', plugins_url('../faanimation/css/font-awesome.min.css', __FILE__));
     wp_enqueue_style('font-awesome');
     $content = wpb_js_remove_wpautop($content);
     // fix unclosed/unwanted paragraph tags in $content
     $output = '';
     $link = vc_build_link($link);
     $output .= '<div class="cq-buttoncontainer ' . $iconposition . ' ' . $extra_class . '">';
     $output .= '<div class="' . $animationstyle . '">';
     $output .= '<div>';
     $output .= '<a href="' . $link['url'] . '" title="' . $link['title'] . '" target="' . $link['target'] . '" style="color:' . $buttoncolor . ';background-color:' . $buttonbackground . ';" class="btn ' . $iconbuttoncolor . '">';
     $output .= '<span class="txt">' . $buttonlabel . '</span>';
     $output .= '<span class="round"><i style="margin-top:' . $icontop . ';margin-left:' . $iconleft . ';" class="fa fa-' . $icon . '"></i></span>';
     $output .= '</a>';
     $output .= '</div>';
     $output .= '</div>';
     $output .= '</div>';
     return $output;
 }
开发者ID:sopada85,项目名称:esquema-test,代码行数:28,代码来源:vc-extensions-cqbutton.php

示例12: wolf_shortcode_testimonial

    /**
     * Testimonial shortcode
     *
     * @param array $atts
     * @param array $content
     * @return string
     */
    function wolf_shortcode_testimonial($atts, $content = null)
    {
        if (class_exists('Vc_Manager') && function_exists('vc_map_get_attributes')) {
            $atts = vc_map_get_attributes('wolf_testimonial', $atts);
        }
        extract(shortcode_atts(array('name' => '', 'avatar' => '', 'link' => ''), $atts));
        $cite = '<cite class="testimonial-cite">';
        if ($avatar) {
            $avatar = wolf_get_url_from_attachment_id(absint($avatar), 'avatar');
        }
        if ($name) {
            $cite .= $name;
        }
        if ($link) {
            $link = esc_url($link);
            $cite .= " | <a href='{$link}' target='_blank'>{$link}</a>";
        }
        $cite .= '</cite>';
        $output = "<div class='slide'><div class='testimonal-container'>";
        if ($avatar) {
            $output .= "<span class='testimonial-avatar'><img src='{$avatar}' alt='testimonial-avatar'></span>";
        }
        $output .= "<blockquote class='testimonial-content'>";
        $output .= sanitize_text_field($content);
        $output .= $cite;
        $output .= '</blockquote>';
        $output .= '</div>
		</div>';
        return $output;
    }
开发者ID:estrategasdigitales,项目名称:dictobas,代码行数:37,代码来源:shortcode-testimonials.php

示例13: icon_font

function icon_font($atts, $content = null)
{
    $atts = vc_map_get_attributes('icon_font', $atts);
    extract($atts);
    $out = $font_icon = $icon_class = $animated = $animated_data = '';
    if ($icon == 'metrize') {
        $font_icon = 'icons-' . $icon_metrize;
        $icon_class = 'metrize';
    } else {
        $font_icon = 'fa-' . $icon_awesome;
        $icon_class = 'awesome';
    }
    if ($css_animation != '') {
        $animated = ' animated ';
        $animated_data = ' data-gen="' . $css_animation . '"';
    }
    $out .= '<div class="icon_font ' . $align . $animated . '"' . $animated_data . '>';
    if ($link != '') {
        $out .= '<a href="' . $link . '" target="blank">';
    }
    $out .= '<i class="' . $font_icon . '" style="color:' . $icon_color . '; font-size:' . $size . 'px; line-height:' . $size . 'px;"></i>';
    if ($link != '') {
        $out .= '</a>';
    }
    $out .= '</div>';
    return $out;
}
开发者ID:devmoonshine,项目名称:development,代码行数:27,代码来源:vc_icons.php

示例14: service_one

function service_one($atts, $content = null)
{
    $title = $description = $icon = $icon_awesome = $icon_metrize = $more = $link = '';
    $atts = vc_map_get_attributes('service_one', $atts);
    extract($atts);
    $out = $service_icon = $icon_class = '';
    if ($icon == 'metrize') {
        $service_icon = 'icons-' . $icon_metrize;
        $icon_class = 'metrize';
    } else {
        $service_icon = 'fa-' . $icon_awesome;
        $icon_class = 'awesome';
    }
    $out .= '<div class="service service-one">';
    $out .= '<div class="s_icon ' . $icon_class . '"><i class="' . $service_icon . '"></i></div>';
    $out .= '<div class="s_info">';
    if ($title != '') {
        $out .= '<h3>' . $title . '</h3>';
    }
    if ($more != '') {
        $out .= '<a class="tbutton small" href="' . $link . '"><span>' . $more . '</span></a>';
    }
    if ($description != '') {
        $out .= '<p>' . $description . '</p>';
    }
    $out .= '</div>';
    $out .= '</div>';
    return $out;
}
开发者ID:devmoonshine,项目名称:development,代码行数:29,代码来源:vc_service_one.php

示例15: content

    protected function content($atts, $content = null)
    {
        $atts = function_exists('vc_map_get_attributes') ? vc_map_get_attributes('lastest_deals_sidebar', $atts) : $atts;
        $atts = shortcode_atts(array('title' => '', 'taxonomy' => '', 'number' => 12, 'autoplay' => "false", 'navigation' => "false", 'slidespeed' => 250, 'loop' => "false", 'items' => 1, 'css_animation' => '', 'el_class' => '', 'css' => ''), $atts);
        extract($atts);
        $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'latest-deals ', $this->settings['base'], $atts), 'extra' => $this->getExtraClass($el_class), 'css_animation' => $this->getCSSAnimation($css_animation), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' '));
        $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass));
        $elementClass = apply_filters('kt_lastest_deals_sidebar_class_container', $elementClass);
        // Get products on sale
        $product_ids_on_sale = wc_get_product_ids_on_sale();
        $meta_query = WC()->query->get_meta_query();
        $args = array('posts_per_page' => $number, 'post_type' => 'product', 'orderby' => 'meta_value_num', 'meta_key' => '_sale_price_dates_to', 'order' => 'DESC', 'no_found_rows' => 1, 'post_status' => 'publish', 'meta_query' => $meta_query, 'post__in' => array_merge(array(0), $product_ids_on_sale));
        if ($taxonomy) {
            $args['tax_query'] = array(array('taxonomy' => 'product_cat', 'field' => 'id', 'terms' => explode(",", $taxonomy)));
        }
        $q = apply_filters('woocommerce_shortcode_products_query', $args, $atts);
        $query = new WP_Query($q);
        global $woocommerce_loop;
        ob_start();
        if ($query->have_posts()) {
            $data_carousel = array("autoplay" => $autoplay, "navigation" => $navigation, "slidespeed" => $slidespeed, "autoheight" => "false", "loop" => $loop, "dots" => "false", 'nav' => "true", "autoplayTimeout" => 1000, "autoplayHoverPause" => "true", 'items' => 1);
            add_filter("woocommerce_get_price_html_from_to", "kt_get_price_html_from_to", 10, 4);
            add_filter('woocommerce_sale_price_html', 'woocommerce_custom_sales_price', 10, 2);
            ?>
            <div class="<?php 
            echo esc_attr($elementClass);
            ?>
">
                <h2 class="latest-deal-title"><?php 
            echo esc_html($title);
            ?>
</h2>
                <div class="latest-deal-content">
                    <ul class="product-list owl-carousel" <?php 
            echo _data_carousel($data_carousel);
            ?>
>
                        <?php 
            add_filter("woocommerce_get_price_html_from_to", "kt_get_price_html_from_to", 10, 4);
            while ($query->have_posts()) {
                $query->the_post();
                wc_get_template_part('content', 'product-sidebar');
            }
            // end of the loop.
            remove_filter("woocommerce_get_price_html_from_to", "kt_get_price_html_from_to", 10, 4);
            ?>
                    </ul>
                </div>
            </div>
            <?php 
            remove_filter("woocommerce_get_price_html_from_to", "kt_get_price_html_from_to", 10, 4);
            remove_filter('woocommerce_sale_price_html', 'woocommerce_custom_sales_price', 10, 2);
        }
        wp_reset_postdata();
        wp_reset_query();
        $result = ob_get_contents();
        ob_clean();
        return $result;
    }
开发者ID:hikaram,项目名称:wee,代码行数:59,代码来源:lastest_deals_sidebar.php


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