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


PHP wpb_getImageBySize函数代码示例

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


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

示例1: content

 protected function content($atts, $content = null)
 {
     extract(shortcode_atts(array('title' => '', 'suffix' => '', 'prefix' => '', 'image' => '', 'link' => '', 'img_size' => 'thumbnail', 'align' => 'center', 'el_class' => '', 'css' => '', 'style' => '1', 'overlay' => '', 'position' => 'middle'), $atts));
     $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'banner ', $this->settings['base'], $atts), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' '), 'extra' => $this->getExtraClass($el_class), 'style' => 'style' . $style, 'overlay' => 'banner-' . $overlay, 'align' => 'banner-' . $align, 'position' => 'position-' . $position);
     $banner_link = '';
     $img_id = preg_replace('/[^\\d]/', '', $image);
     $img = wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => $img_size, 'class' => 'img-responsive'));
     if ($img == null) {
         $img['thumbnail'] = '<img class="vc_img-placeholder img-responsive" src="' . vc_asset_url('vc/no_image.png') . '" />';
     }
     $output = $img['thumbnail'];
     $suffix = $suffix ? '<p class="banner-suffix">' . $suffix . '</p>' : '';
     $prefix = $prefix ? '<p class="banner-prefix">' . $prefix . '</p>' : '';
     $output .= sprintf('<div class="banner-content">%s<h3 class="banner-title">%s</h3>%s</div>', $suffix, $title, $prefix);
     if ($link) {
         $link = vc_build_link($link);
         $a_href = $link['url'];
         $a_title = $link['title'];
         $a_target = $link['target'];
         $icon_box_link = array('href="' . esc_attr($a_href) . '"', 'title="' . esc_attr($a_title) . '"', 'target="' . esc_attr($a_target) . '"');
         $banner_link = '<a class="banner-link" ' . implode(' ', $icon_box_link) . '></a>';
     }
     $output .= $banner_link;
     $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass));
     return '<div class="' . esc_attr($elementClass) . '">' . $output . '</div>';
 }
开发者ID:websideas,项目名称:Mondova,代码行数:26,代码来源:banner.php

示例2: content

 protected function content($atts, $content = null)
 {
     $atts = shortcode_atts(array('image' => '', 'img_size' => 'thumbnail', 'values' => '', 'css_animation' => '', 'animation_delay' => '', 'el_class' => '', 'css' => ''), $atts);
     extract($atts);
     $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'image-tooltip', $this->settings['base'], $atts), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' '), 'extra' => $this->getExtraClass($el_class), 'css_animation' => cruxstore_getCSSAnimation($css_animation));
     $img_id = preg_replace('/[^\\d]/', '', $image);
     $img = wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => $img_size, 'class' => 'img-responsive'));
     if ($img == null) {
         $img['thumbnail'] = '<img class="vc_img-placeholder img-responsive" src="' . vc_asset_url('vc/no_image.png') . '" />';
     }
     $output = '';
     $values = (array) vc_param_group_parse_atts($values);
     $text = '';
     $left_text = '';
     $left_right = '';
     foreach ($values as $key => $data) {
         $new_line = $data;
         $new_line['left'] = isset($data['left']) ? $data['left'] : 0;
         $new_line['top'] = isset($data['top']) ? $data['top'] : 0;
         $new_line['label'] = isset($data['label']) ? $data['label'] : '';
         $new_line['color'] = isset($data['color']) ? $data['color'] : 'default';
         $new_line['color'] = isset($data['color']) ? $data['color'] : 'default';
         $new_line['content'] = isset($data['content']) ? $data['content'] : '';
         $active = $key == 0 ? ' active' : '';
         $text .= sprintf('<div class="image-tooltip-item %s" style="top: %s; left: %s;"><div class="image-tooltip-content" data-count="%s" title="%s"></div></div>', 'tooltip-' . $new_line['color'] . $active, $new_line['top'] . '%', $new_line['left'] . '%', $key, $new_line['label']);
         $tooltip = sprintf('<div class="image-tooltip-element %s" data-count="%s"><h4>%s</h4><div>%s</div></div>', $active, $key, $new_line['label'], $data['content']);
         if ($new_line['align'] == 'right') {
             $left_right .= $tooltip;
         } else {
             $left_text .= $tooltip;
         }
     }
     $output = sprintf('<div class="row"><div class="image-tooltip-left col-md-4">%s</div><div class="image-tooltip-center col-md-4">%s %s</div><div class="image-tooltip-right col-md-4">%s</div></div>', $left_text, '<div class="image-tooltip-image">' . $img['thumbnail'] . '</div>', '<div class="image-tooltip-text">' . $text . '</div>', $left_right);
     $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass));
     if ($animation_delay) {
         $animation_delay = sprintf(' data-wow-delay="%sms"', $animation_delay);
     }
     return '<div class="' . esc_attr($elementClass) . '"' . $animation_delay . '>' . $output . '</div>';
 }
开发者ID:websideas,项目名称:Mondova,代码行数:39,代码来源:image_tooltip.php

示例3: wf_owlcarousel_func

function wf_owlcarousel_func($atts, $content = null)
{
    $args = shortcode_atts(array("items" => 3, "loop" => 'true', "navpos" => 'top', "images" => 'images', "size" => 'full', "singleitem1" => 'true', "autoplay1" => 'true', "stoponhover1" => 'false', "navigation" => 'true', "autoheight1" => 'false', "mousedrag1" => 'true', "touchDrag" => 'true', "addclassactive1" => 'true', "pagination" => 'false'), $atts);
    $content = wpb_js_remove_wpautop($content, true);
    // fix unclosed/unwanted paragraph tags in $content
    $id = "wf_owl_carousel_" . uniqid();
    $items = $args['items'];
    $images = $args['images'];
    $images = explode(',', $images);
    $size = $args['size'];
    $items = $args['items'];
    $navpos = $args['navpos'];
    $singleitem = $args['singleitem1'];
    $autoplay = $args['autoplay1'];
    $stoponhover = $args['stoponhover1'];
    $navigation = $args['navigation'];
    $autoHeight = $args['autoheight1'];
    $mouseDrag = $args['mousedrag1'];
    $touchDrag = $args['touchDrag'];
    $pagination = $args['pagination'];
    $loop = $args['loop'];
    $addClassActive = $args['addclassactive1'];
    wp_enqueue_script("js.owl.carousel", plugin_dir_url(__FILE__) . 'js/owl.carousel.js', array('jquery'), false);
    wp_enqueue_script('js.owl.carousel', array('jquery'), false);
    $output = '';
    $output .= '<div class="wf_owl_carousel owl-carousel owl-theme" id="' . $id . '">';
    foreach ($images as $attach_id) {
        if ($attach_id > 0) {
            $post_thumbnail = wpb_getImageBySize(array('attach_id' => $attach_id, 'thumb_size' => $size));
        } else {
            $post_thumbnail = array();
            $post_thumbnail['thumbnail'] = '<img src="' . plugin_dir_path(dirname(__FILE__)) . '/images/wf_modal.jpg" />';
            $post_thumbnail['p_img_large'][0] = plugin_dir_path(dirname(__FILE__)) . " /images/wf_modal.jpg";
        }
        $thumbnail = $post_thumbnail['thumbnail'];
        $output .= '<div class="item">' . $thumbnail . '</div>';
    }
    $output .= '</div>';
    $output .= '<script type="text/javascript">jQuery(document).ready(function($) {';
    $output .= " jQuery('#" . $id . "').owlCarousel({";
    if ($singleitem === 'false') {
        $output .= "items : " . $items . ",";
    }
    if ($autoplay === 'true') {
        $output .= "autoPlay : 2500,";
    }
    $output .= '
	loop:' . $loop . ',
	autoPlay : ' . $autoplay . ',
	singleItem : ' . $singleitem . ',
	//margin: 6,
	stoponhover : ' . $stoponhover . ',
	autoHeight: ' . $autoHeight . ',
	mouseDrag: ' . $mouseDrag . ',
	touchDrag: ' . $touchDrag . ',
	addClassActive: ' . $addClassActive . ',
	navigation: ' . $navigation . ',
	navigationText :[ "<" , ">"],
	pagination: ' . $pagination . ',';
    $output .= " });";
    $output .= "});</script>";
    if ($singleitem === 'true') {
        $output .= "<style>\n    #" . $id . " .item img{\n        display: block !important;\n        width: 100% !important;\n        height: auto !important;\n    }\n    .attachment-full {\n    height: auto !important;\n    display: block !important;\n    width: 100% !important;\n}\n#" . $id . " .item{margin: 0px !important;}\n</style>";
    }
    if ($navpos === 'center') {
        $output .= "<style> #" . $id . " .owl-buttons {left: 0;\n    position: absolute;\n    top: 35% !important;\n    width: 100% !important;\n    opacity: 0.6;\n}#" . $id . " .item{margin: 3px;}\n #" . $id . " .owl-wrapper {\n    margin-top: 0px !important;\n}\n #" . $id . " .owl-prev {\n    left: 0 !important;\n    position: absolute;\n}\n #" . $id . " .owl-next {\n    position: absolute;\n    right: 0!important;\n}\n #" . $id . " .owl-prev, #" . $id . " .owl-next {\n    border: medium none !important;\n    border-radius: 0 !important;\n    color: white;\n    font-size: 1.2em !important;\n    margin: 0 auto !important;\n    text-align: center;\n    background: blue none repeat scroll 0 0 !important;\n}\n</style>";
    } else {
        $output .= '<style>#' . $id . ' .item{margin: 3px;} #' . $id . ' .owl-prev,#' . $id . ' .owl-next {
    border: medium none !important;
    border-radius: 0 !important;
    color: white;
    font-size: 1.2em !important;
    margin: 0 auto !important;
    text-align: center;
    background: blue none repeat scroll 0 0 !important;
}#' . $id . ' .owl-buttons {
    position: absolute;
    right: 0;
    top: 0;
}#' . $id . ' .owl-wrapper {
    margin-top: 40px;
}

</style>';
    }
    return $output;
}
开发者ID:prosatya,项目名称:WF-Gmap,代码行数:87,代码来源:wf_owlcarousel.php

示例4: extract

<?php

$output = $style1 = $style2 = $style3 = '';
extract(shortcode_atts(array('image' => '', 'title' => '', 'ca' => 'center', 'bg' => '', 'bo' => '', 'bc' => '', 'bw' => '', 'text_scheme' => 'default'), $atts));
$img_id = preg_replace('/[^\\d]/', '', $image);
$img = wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => 'full'));
if ($bg != '') {
    $rgb = brad_hex2rgb($bg);
    $rgba = "rgba({$rgb[0]} , {$rgb[1]} , {$rgb[2]} , {$bo})";
    $style3 = " style='background-color:{$rgba}'";
}
if ($bc != '') {
    $style2 = " style='border:{$bw}px solid {$bc};'";
}
$output .= "\n\t" . '<div class="teaser valign-' . $ca . '">';
$output .= "\n\t\t" . '<div class="image hoverlay">' . $img['thumbnail'];
$output .= "\n\t\t\t" . '<div class="teaser-container"><div class="box content-box ' . $text_scheme . '" ' . $style2 . '><div class="box-inner" ' . $style3 . '><div>';
if ($title != '') {
    $output .= '<h2 class="teaser-heading"><span>' . $title . '</span></h2>';
}
if ($content != '') {
    $output .= "\n\t\t\t\t" . '<div class="teaser-content">' . wpb_js_remove_wpautop($content) . '</div>';
}
$output .= "\n\t" . '</div></div></div></div></div></div> ' . $this->endBlockComment('.teaser');
echo $output;
开发者ID:jmead,项目名称:trucell-cms,代码行数:25,代码来源:vc_teaser_box.php

示例5: thb_image

function thb_image($atts, $content = null)
{
    extract(shortcode_atts(array('image' => '', 'target_blank' => false, 'img_size' => 'thumbnail', 'img_link' => '', 'img_link_target' => '', 'alignment' => '', 'lightbox' => '', 'size' => 'small', 'animation' => false), $atts));
    $img_id = preg_replace('/[^\\d]/', '', $image);
    $img = wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => $img_size, 'class' => $animation . ' ' . $alignment));
    if ($img == NULL) {
        $img = '<img src="http://placekitten.com/g/400/300" />';
    }
    $link_to = $c_lightbox = '';
    if ($lightbox == true) {
        $link_to = wp_get_attachment_image_src($img_id, 'large');
        $link_to = $link_to[0];
        $c_lightbox = ' rel="magnific"';
    } else {
        if (!empty($img_link)) {
            $link_to = $img_link;
        }
    }
    $css_class = ' class="align' . $alignment . '"';
    if (!empty($link_to) && !preg_match('/^(https?\\:\\/\\/|\\/\\/)/', $link_to)) {
        $link_to = 'http://' . $link_to;
    }
    $out = !empty($link_to) ? '<a' . $css_class . ' ' . $c_lightbox . ' href="' . $link_to . '"' . ($target_blank ? ' target="_blank"' : '') . '>' . $img['thumbnail'] . '</a>' : $img['thumbnail'];
    return $out;
}
开发者ID:primarydesign,项目名称:the-color-mint,代码行数:25,代码来源:shortcode.php

示例6: getPostThumbnail

 protected function getPostThumbnail($grid_layout, $post_id, $grid_thumb_size)
 {
     if (in_array($grid_layout, array('title_thumbnail_text', 'thumbnail_title_text', 'thumbnail_text', 'thumbnail_title', 'thumbnail', 'title_text'))) {
         return wpb_getImageBySize(array('post_id' => $post_id, 'thumb_size' => $grid_thumb_size));
     }
     return false;
 }
开发者ID:ksingh812,项目名称:thub-old,代码行数:7,代码来源:posts_grid.php

示例7: singleParamHtmlHolder

 public function singleParamHtmlHolder($param, $value)
 {
     $output = '';
     // Compatibility fixes
     $old_names = array('yellow_message', 'blue_message', 'green_message', 'button_green', 'button_grey', 'button_yellow', 'button_blue', 'button_red', 'button_orange');
     $new_names = array('alert-block', 'alert-info', 'alert-success', 'btn-success', 'btn', 'btn-info', 'btn-primary', 'btn-danger', 'btn-warning');
     $value = str_ireplace($old_names, $new_names, $value);
     $param_name = isset($param['param_name']) ? $param['param_name'] : '';
     $type = isset($param['type']) ? $param['type'] : '';
     $class = isset($param['class']) ? $param['class'] : '';
     if ('attach_image' === $param['type'] && 'image' === $param_name) {
         $output .= '<input type="hidden" class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '" value="' . $value . '" />';
         $element_icon = $this->settings('icon');
         $img = wpb_getImageBySize(array('attach_id' => (int) preg_replace('/[^\\d]/', '', $value), 'thumb_size' => 'thumbnail'));
         $this->setSettings('logo', ($img ? $img['thumbnail'] : '<img width="150" height="150" src="' . vc_asset_url('vc/blank.gif') . '" class="attachment-thumbnail vc_element-icon"  data-name="' . $param_name . '" alt="" title="" style="display: none;" />') . '<span class="no_image_image vc_element-icon' . (!empty($element_icon) ? ' ' . $element_icon : '') . ($img && !empty($img['p_img_large'][0]) ? ' image-exists' : '') . '" /><a href="#" class="column_edit_trigger' . ($img && !empty($img['p_img_large'][0]) ? ' image-exists' : '') . '">' . __('Add image', 'js_composer') . '</a>');
         $output .= $this->outputTitleTrue($this->settings['name']);
     } elseif (!empty($param['holder'])) {
         if ($param['holder'] === 'input') {
             $output .= '<' . $param['holder'] . ' readonly="true" class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '" value="' . $value . '">';
         } elseif (in_array($param['holder'], array('img', 'iframe'))) {
             $output .= '<' . $param['holder'] . ' class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '" src="' . $value . '">';
         } elseif ($param['holder'] !== 'hidden') {
             $output .= '<' . $param['holder'] . ' class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '">' . $value . '</' . $param['holder'] . '>';
         }
     }
     if (!empty($param['admin_label']) && $param['admin_label'] === true) {
         $output .= '<span class="vc_admin_label admin_label_' . $param['param_name'] . (empty($value) ? ' hidden-label' : '') . '"><label>' . $param['heading'] . '</label>: ' . $value . '</span>';
     }
     return $output;
 }
开发者ID:VitaAprel,项目名称:mynotebook,代码行数:30,代码来源:vc-single-image.php

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

示例9: singleParamHtmlHolder

 public function singleParamHtmlHolder($param, $value)
 {
     $output = '';
     // Compatibility fixes
     $param_name = isset($param['param_name']) ? $param['param_name'] : '';
     $type = isset($param['type']) ? $param['type'] : '';
     $class = isset($param['class']) ? $param['class'] : '';
     if ($type == 'attach_image' and $param_name == 'image') {
         $output .= '<input type="hidden" class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '" value="' . $value . '" />';
         $element_icon = $this->settings('icon');
         $img = wpb_getImageBySize(array('attach_id' => (int) preg_replace('/[^\\d]/', '', $value), 'thumb_size' => 'thumbnail'));
         $logo_html = '';
         if ($img) {
             $logo_html .= $img['thumbnail'];
         } else {
             $logo_html .= '<img width="150" height="150" class="attachment-thumbnail icon-wpb-single-image vc_element-icon"  data-name="' . $param_name . '" alt="" title="" style="display: none;" />';
         }
         $logo_html .= '<span class="no_image_image vc_element-icon' . (!empty($element_icon) ? ' ' . $element_icon : '') . ($img && !empty($img['p_img_large'][0]) ? ' image-exists' : '') . '" />';
         $this->setSettings('logo', $logo_html);
         $output .= $this->outputTitleTrue($this->settings['name']);
     } elseif (!empty($param['holder'])) {
         if ($param['holder'] == 'input') {
             $output .= '<' . $param['holder'] . ' readonly="true" class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '" value="' . $value . '">';
         } elseif (in_array($param['holder'], array('img', 'iframe'))) {
             $output .= '<' . $param['holder'] . ' class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '" src="' . $value . '">';
         } elseif ($param['holder'] !== 'hidden') {
             $output .= '<' . $param['holder'] . ' class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '">' . $value . '</' . $param['holder'] . '>';
         }
     }
     if (!empty($param['admin_label']) && $param['admin_label'] === TRUE) {
         $output .= '<span class="vc_admin_label admin_label_' . $param['param_name'] . (empty($value) ? ' hidden-label' : '') . '"><label>' . __($param['heading'], 'js_composer') . '</label>: ' . $value . '</span>';
     }
     return $output;
 }
开发者ID:afquinterog,项目名称:zephyr,代码行数:34,代码来源:shortcode-us-single-image.php

示例10: singleParamHtmlHolder

 public function singleParamHtmlHolder($param, $value)
 {
     $output = '';
     // Compatibility fixes
     // TODO: check $old_names & &new_names. Leftover from copypasting?
     $old_names = array('yellow_message', 'blue_message', 'green_message', 'button_green', 'button_grey', 'button_yellow', 'button_blue', 'button_red', 'button_orange');
     $new_names = array('alert-block', 'alert-info', 'alert-success', 'btn-success', 'btn', 'btn-info', 'btn-primary', 'btn-danger', 'btn-warning');
     $value = str_ireplace($old_names, $new_names, $value);
     $param_name = isset($param['param_name']) ? $param['param_name'] : '';
     $type = isset($param['type']) ? $param['type'] : '';
     $class = isset($param['class']) ? $param['class'] : '';
     if (isset($param['holder']) && 'hidden' !== $param['holder']) {
         $output .= '<' . $param['holder'] . ' class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '">' . $value . '</' . $param['holder'] . '>';
     }
     if ('include' === $param_name) {
         $images_ids = empty($value) ? array() : explode(',', trim($value));
         $output .= '<ul class="attachment-thumbnails' . (empty($images_ids) ? ' image-exists' : '') . '" data-name="' . $param_name . '">';
         foreach ($images_ids as $image) {
             $img = wpb_getImageBySize(array('attach_id' => (int) $image, 'thumb_size' => 'thumbnail'));
             $output .= $img ? '<li>' . $img['thumbnail'] . '</li>' : '<li><img width="150" height="150" test="' . $image . '" src="' . vc_asset_url('vc/blank.gif') . '" class="attachment-thumbnail" alt="" title="" /></li>';
         }
         $output .= '</ul>';
         $output .= '<a href="#" class="column_edit_trigger' . (!empty($images_ids) ? ' image-exists' : '') . '">' . __('Add images', 'js_composer') . '</a>';
     }
     return $output;
 }
开发者ID:ksan5835,项目名称:maadithottam,代码行数:26,代码来源:vc-media-grid.php

示例11: singleParamHtmlHolder

 public function singleParamHtmlHolder($param, $value)
 {
     $output = '';
     // Compatibility fixes
     $old_names = array('yellow_message', 'blue_message', 'green_message', 'button_green', 'button_grey', 'button_yellow', 'button_blue', 'button_red', 'button_orange');
     $new_names = array('alert-block', 'alert-info', 'alert-success', 'btn-success', 'btn', 'btn-info', 'btn-primary', 'btn-danger', 'btn-warning');
     $value = str_ireplace($old_names, $new_names, $value);
     //$value = __($value, LANGUAGE_ZONE);
     //
     $param_name = isset($param['param_name']) ? $param['param_name'] : '';
     $type = isset($param['type']) ? $param['type'] : '';
     $class = isset($param['class']) ? $param['class'] : '';
     if (isset($param['holder']) == true && $param['holder'] !== 'hidden') {
         $output .= '<' . $param['holder'] . ' class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '">' . $value . '</' . $param['holder'] . '>';
     }
     if ($param_name == 'images') {
         $images_ids = empty($value) ? array() : explode(',', trim($value));
         $output .= '<ul class="attachment-thumbnails' . (empty($images_ids) ? ' image-exists' : '') . '" data-name="' . $param_name . '">';
         foreach ($images_ids as $image) {
             $img = wpb_getImageBySize(array('attach_id' => (int) $image, 'thumb_size' => 'thumbnail'));
             $output .= $img ? '<li>' . $img['thumbnail'] . '</li>' : '<li><img width="150" height="150" test="' . $image . '" src="' . WPBakeryVisualComposer::getInstance()->assetURL('vc/blank.gif') . '" class="attachment-thumbnail" alt="" title="" /></li>';
         }
         $output .= '</ul>';
         $output .= '<a href="#" class="column_edit_trigger' . (!empty($images_ids) ? ' image-exists' : '') . '">' . __('Add images', LANGUAGE_ZONE) . '</a>';
     }
     return $output;
 }
开发者ID:scottnkerr,项目名称:eeco,代码行数:27,代码来源:image_gallery.php

示例12: content

 protected function content($atts, $content = null)
 {
     extract(shortcode_atts(array('mode' => '', 'effect' => '', "speed" => '', "pause" => '', 'autoplay' => '', 'controlnav' => '', 'pagernav' => '', 'img_size' => 'thumbnail', 'slide_count' => 1, 'el_id' => '', 'el_class' => '', 'css_animation' => '', 'anim_type' => '', 'anim_delay' => '', 'css' => ''), $atts));
     $sc_class = 'wt_testimonials_slider_sc';
     $id = mt_rand(9999, 99999);
     if (trim($el_id) != false) {
         $el_id = esc_attr(trim($el_id));
     } else {
         $el_id = $sc_class . '-' . $id;
     }
     wp_print_scripts('wt-extend-bx-slider');
     wp_enqueue_style('wt-extend-bx-slider');
     $output = '';
     $autoplay !== "true" ? $autoplay = 'false' : '';
     $controlnav !== "true" ? $controlnav = 'false' : '';
     $pagernav !== "true" ? $pagernav = 'false' : '';
     $el_class = esc_attr($this->getExtraClass($el_class));
     $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $sc_class . $el_class . vc_shortcode_custom_css_class($css, ' '), $this->settings['base']);
     $css_class .= $this->wt_sc->getWTCSSAnimationClass($css_animation, $anim_type);
     $anim_data = $this->wt_sc->getWTCSSAnimationData($css_animation, $anim_delay);
     $speed = (int) $speed;
     $pause = (int) $pause;
     $img_size = esc_html($img_size);
     $output .= '<div id="' . $el_id . '" class="' . $css_class . '"' . $anim_data . '>';
     $output .= "\n\t\t\t" . '<ul class="wt_bxslider" data-bx-mode="' . $mode . '" data-bx-effect="' . $effect . '" data-bx-speed="' . $speed . '" data-bx-pause="' . $pause . '" data-bx-autoPlay="' . $autoplay . '" data-bx-controlNav="' . $controlnav . '" data-bx-pagerNav="' . $pagernav . '">';
     for ($i = 1; $i <= $slide_count; $i++) {
         $item_content = '';
         $image = '';
         isset($atts["content_" . $i]) && $atts["content_" . $i] != "" ? $item_content = $atts["content_" . $i] : '';
         if ($item_content != '') {
             $item_content = wpb_js_remove_wpautop($item_content, true);
             // fix unclosed/unwanted paragraph tags in $content
         }
         if ($atts["image_" . $i] != NULL) {
             $image = $atts["image_" . $i];
             $img_id = preg_replace('/[^\\d]/', '', $image);
             $img = wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => $img_size, 'class' => 'wt_testimonial_image'));
         } else {
             $image = '';
         }
         isset($atts["target_" . $i]) && $atts["target_" . $i] == "true" ? $target = '_blank' : ($target = '_self');
         $output .= "\n\t\t\t\t" . '<li class="item">';
         if ($image != '') {
             $output .= "\n\t\t\t\t\t" . $img['thumbnail'];
         }
         $output .= "\n\t\t\t\t\t" . $item_content;
         if (isset($atts["name_" . $i]) && $atts["name_" . $i] != "") {
             $item_name = esc_html($atts["name_" . $i]);
             if (isset($atts["link_" . $i]) && $atts["link_" . $i] != "") {
                 $output .= "\n\t\t\t\t\t" . '<h3><a href="' . esc_url($atts["link_" . $i]) . '" title="' . $item_name . '" target="' . $target . '">' . $item_name . '</a></h3>';
             } else {
                 $output .= "\n\t\t\t\t\t" . '<h3>' . $item_name . '</h3>';
             }
         }
         $output .= "\t\t\t\t" . '</li>';
     }
     $output .= "\n\t\t\t" . '</ul>';
     $output .= "\n\t\t\t" . '</div>';
     return $output;
 }
开发者ID:panchortuzar,项目名称:revistaemprendedores-shop,代码行数:60,代码来源:wt_vcsc_testimonials_slider.php

示例13: thb_image

function thb_image($atts, $content = null)
{
    extract(shortcode_atts(array('image' => '', 'target_blank' => false, 'img_size' => 'full', 'img_link' => '', 'alignment' => '', 'lightbox' => '', 'full_width' => false, 'size' => 'full', 'animation' => false), $atts));
    $img_id = preg_replace('/[^\\d]/', '', $image);
    $full = $full_width == 'true' ? 'full' : '';
    $img = wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => $img_size, 'class' => $animation . ' ' . $alignment . ' ' . $full));
    if ($img == NULL) {
        $img['thumbnail'] = '<img src="http://placekitten.com/g/400/300" />';
    }
    $link_to = $c_lightbox = '';
    if ($lightbox == true) {
        $link_to = wp_get_attachment_image_src($img_id, 'large');
        $link_to = $link_to[0];
        $c = ' class="fresco overlay-effect"';
    } else {
        $img_link = $img_link == '||' ? '' : $img_link;
        $link = vc_build_link($img_link);
        $c = ' class="overlay-effect"';
        $link_to = $link['url'];
        $a_title = $link['title'];
        $a_target = $link['target'];
    }
    $out = !empty($link_to) ? '<a ' . $c . ' href="' . $link_to . '" target="' . esc_attr($a_target) . '" title="' . esc_attr($a_title) . '"><div class="simple-overlay"></div>' . $img['thumbnail'] . '</a>' : $img['thumbnail'];
    return $out;
}
开发者ID:adampdarcy,项目名称:paola,代码行数:25,代码来源:thb_image.php

示例14: singleParamHtmlHolder

 public function singleParamHtmlHolder($param, $value)
 {
     $output = '';
     // Compatibility fixes
     $old_names = array('yellow_message', 'blue_message', 'green_message', 'button_green', 'button_grey', 'button_yellow', 'button_blue', 'button_red', 'button_orange');
     $new_names = array('alert-block', 'alert-info', 'alert-success', 'btn-success', 'btn', 'btn-info', 'btn-primary', 'btn-danger', 'btn-warning');
     $value = str_ireplace($old_names, $new_names, $value);
     //$value = __($value, "js_composer");
     //
     $param_name = isset($param['param_name']) ? $param['param_name'] : '';
     $type = isset($param['type']) ? $param['type'] : '';
     $class = isset($param['class']) ? $param['class'] : '';
     if (isset($param['holder']) == false || $param['holder'] == 'hidden') {
         $output .= '<input type="hidden" class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '" value="' . $value . '" />';
         if ($param['type'] == 'attach_image') {
             $img = wpb_getImageBySize(array('attach_id' => (int) preg_replace('/[^\\d]/', '', $value), 'thumb_size' => 'thumbnail'));
             $output .= ($img ? $img['thumbnail'] : '<img width="150" height="150" src="' . WPBakeryVisualComposer::getInstance()->assetURL('vc/blank.gif') . '" class="attachment-thumbnail"  data-name="' . $param_name . '" alt="" title="" style="display: none;" />') . '<img src="' . WPBakeryVisualComposer::getInstance()->assetURL('vc/elements_icons/single_image.png') . '" class="no_image_image' . ($img && !empty($img['p_img_large'][0]) ? ' image-exists' : '') . '" /><a href="#" class="column_edit_trigger' . ($img && !empty($img['p_img_large'][0]) ? ' image-exists' : '') . '">' . __('Add image', 'js_composer') . '</a>';
         } else {
             if ($param['type'] == 'attach_video') {
                 $img = wpb_getImageBySize(array('attach_id' => (int) preg_replace('/[^\\d]/', '', $value), 'thumb_size' => 'thumbnail'));
                 $output .= ($img ? $img['thumbnail'] : '<img width="150" height="150" src="' . WPBakeryVisualComposer::getInstance()->assetURL('vc/blank.gif') . '" class="attachment-thumbnail"  data-name="' . $param_name . '" alt="" title="" style="display: none;" />') . '<img src="' . WPBakeryVisualComposer::getInstance()->assetURL('vc/elements_icons/single_image.png') . '" class="no_image_image' . ($img && !empty($img['p_img_large'][0]) ? ' image-exists' : '') . '" /><a href="#" class="column_edit_trigger' . ($img && !empty($img['p_img_large'][0]) ? ' image-exists' : '') . '">' . __('Add image', 'js_composer') . '</a>';
             }
         }
     } else {
         $output .= '<' . $param['holder'] . ' class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '">' . $value . '</' . $param['holder'] . '>';
     }
     return $output;
 }
开发者ID:Quartermain,项目名称:strategic,代码行数:28,代码来源:single_image.php

示例15: content

 protected function content($atts, $content = null)
 {
     extract(shortcode_atts(array('name' => '', 'image' => '', 'image_size' => 'full', 'agency' => '', 'facebook_link' => '', 'twitter_link' => '', 'dribbble_link' => '', 'linkedin_link' => '', 'el_class' => '', 'css' => ''), $atts));
     $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'team ', $this->settings['base'], $atts), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' '), 'extra' => $this->getExtraClass($el_class));
     $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass));
     $img_id = preg_replace('/[^\\d]/', '', $image);
     $img = wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => $image_size, 'class' => 'vc_single_image-img img-responsive team-avatar'));
     if ($img == null) {
         $img['thumbnail'] = '<img class="vc_img-placeholder vc_single_image-img team-avatar" src="' . vc_asset_url('vc/no_image.png') . '" />';
     }
     $output = '';
     $socials = array('<i class="fa fa-facebook"></i>' => $facebook_link, '<i class="fa fa-twitter"></i>' => $twitter_link, '<i class="fa fa-dribbble"></i>' => $dribbble_link, '<i class="fa fa-linkedin"></i>' => $linkedin_link);
     if ($name) {
         $output .= '<div class="' . $elementClass . '">';
         $output .= $img['thumbnail'];
         $output .= '<div class="team-attr">';
         $output .= '<h4 class="name">' . $name . '</h4>';
         $output .= '<div class="agency">' . $agency . '</div>';
         if ($facebook_link || $twitter_link || $dribbble_link || $linkedin_link) {
             $output .= '<ul class="clearfix">';
             foreach ($socials as $key => $value) {
                 if ($value) {
                     $output .= '<li><a href="' . $value . '">' . $key . '</a></li>';
                 }
             }
             $output .= '</ul>';
         }
         $output .= '</div>';
         $output .= '</div>';
     }
     return $output;
 }
开发者ID:websideas,项目名称:Mondova,代码行数:32,代码来源:team.php


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