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


PHP presscore_shortcode_animation_on函数代码示例

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


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

示例1: shortcode_icon

 public function shortcode_icon($atts, $content = null)
 {
     extract(shortcode_atts(array('icon' => '', 'target_blank' => '1', 'link' => '#'), $atts));
     static $social_icons = null;
     if (!$social_icons) {
         $social_icons = presscore_get_social_icons_data();
     }
     if ('deviant' == $icon) {
         $icon = 'devian';
     } elseif ('tumblr' == $icon) {
         $icon = 'tumbler';
     } elseif ('500px' == $icon) {
         $icon = 'px-500';
     } elseif (in_array($icon, array('youtube', 'YouTube'))) {
         $icon = 'you-tube';
     } elseif (in_array($icon, array('tripedvisor', 'tripadvisor'))) {
         $icon = 'tripedvisor';
     }
     $icon = in_array($icon, array_keys($social_icons)) ? $icon : '';
     if (empty($icon)) {
         return '';
     }
     $classes = array();
     if (presscore_shortcode_animation_on(self::$atts['animation'])) {
         $classes[] = presscore_get_shortcode_animation_html_class(self::$atts['animation']);
     }
     $target_blank = apply_filters('dt_sanitize_flag', $target_blank) ? '_blank' : '';
     $output = presscore_get_social_icon($icon, $link, $social_icons[$icon], $classes, $target_blank);
     return $output;
 }
开发者ID:10asfar,项目名称:WordPress-the7-theme-demo-,代码行数:30,代码来源:social-icons.php

示例2: render_logo

 public function render_logo($attributes = array())
 {
     $post_id = get_the_ID();
     if (!$post_id) {
         return '';
     }
     $html = '';
     $images = array('normal' => null, 'retina' => null);
     $image_classes = array();
     $esc_title = esc_attr(get_the_title());
     $thumb_id = 0;
     // get featured image
     if (has_post_thumbnail($post_id)) {
         $thumb_id = get_post_thumbnail_id($post_id);
         $images['normal'] = wp_get_attachment_image_src($thumb_id, 'full');
     }
     // get retina image
     $retina_logo_id = get_post_meta($post_id, '_dt_logo_options_retina_logo', true);
     if ($retina_logo_id) {
         $images['retina'] = dt_get_uploaded_logo(array('', $retina_logo_id[0]), 'retina');
     }
     // default image
     $default_img = null;
     foreach ($images as $image) {
         if ($image) {
             $default_img = $image;
             break;
         }
     }
     if (!$default_img) {
         return '';
     }
     if (presscore_shortcode_animation_on($attributes['animation'])) {
         $image_classes[] = presscore_get_shortcode_animation_html_class($attributes['animation']);
     }
     // ninjaaaa!
     $image_classes = implode(' ', $image_classes);
     // final image
     if (presscore_is_srcset_based_retina()) {
         $image = presscore_get_image_with_srcset($images['normal'], $images['retina'], $default_img, 'alt="' . $esc_title . '"', esc_attr($image_classes));
     } else {
         $image = dt_get_retina_sensible_image($images['normal'], $images['retina'], $default_img, 'alt="' . $esc_title . '"', esc_attr($image_classes));
     }
     // if link not empty - wrap image with it
     $link = get_post_meta($post_id, '_dt_logo_options_link', true);
     if ($link) {
         $image_id = dt_is_hd_device() && isset($retina_logo_id[0]) ? $retina_logo_id[0] : $thumb_id;
         $esc_caption = '';
         $attachment = dt_get_attachment($image_id);
         if ($attachment) {
             $esc_caption = esc_attr($attachment['description']);
         }
         $link = esc_attr($link);
         $image = '<a href="' . $link . '" target="_blank" title="' . $esc_caption . '" >' . $image . '</a>';
     }
     // get it all togeather
     return $image;
 }
开发者ID:noman90rauf,项目名称:wp-content,代码行数:58,代码来源:logos.php

示例3: shortcode

 public function shortcode($atts, $content = null)
 {
     $default_atts = array('animation' => 'none');
     extract(shortcode_atts($default_atts, $atts));
     $classes = array();
     if (presscore_shortcode_animation_on($animation)) {
         $classes[] = presscore_get_shortcode_animation_html_class($animation);
     }
     // ninjaaaa!
     $classes = implode(' ', $classes);
     $output = '<div class="' . esc_attr($classes) . '">' . presscore_remove_wpautop($content, true) . '</div>';
     return $output;
 }
开发者ID:RDePoppe,项目名称:luminaterealestate,代码行数:13,代码来源:animated-text.php

示例4: get_container_html_class

 protected function get_container_html_class($custom_class = '')
 {
     $class = array();
     if ($custom_class) {
         $class[] = $custom_class;
     }
     if ($this->atts['link']) {
         $class[] = 'shortcode-banner-link';
     }
     if (presscore_shortcode_animation_on($this->atts['animation'])) {
         $class[] = presscore_get_shortcode_animation_html_class($this->atts['animation']);
     }
     return 'class="' . esc_attr(implode(' ', $class)) . '"';
 }
开发者ID:noman90rauf,项目名称:wp-content,代码行数:14,代码来源:banner.php

示例5: shortcode

 public function shortcode($atts, $content = null)
 {
     $default_atts = array('type' => 'blockquote', 'layout' => 'left', 'font_size' => 'big', 'size' => '1', 'animation' => 'none', 'background' => 'plain');
     extract(shortcode_atts($default_atts, $atts));
     $font_size = sanitize_key($font_size);
     $type = sanitize_key($type);
     $layout = sanitize_key($layout);
     $size = sanitize_key($size);
     $background = sanitize_key($background);
     $classes = array();
     $classes[] = presscore_get_font_size_class($font_size);
     if (presscore_shortcode_animation_on($animation)) {
         $classes[] = presscore_get_shortcode_animation_html_class($animation);
     }
     if ('blockquote' != $type) {
         $tag = 'q';
         $autop = false;
         $classes[] = 'shortcode-pullquote';
         $classes[] = 'wf-cell';
         if ('right' == $layout) {
             $classes[] = 'align-right';
         } else {
             $classes[] = 'align-left';
         }
         switch ($size) {
             case '2':
                 $classes[] = 'wf-1-2';
                 break;
             case '3':
                 $classes[] = 'wf-1-3';
                 break;
             case '4':
                 $classes[] = 'wf-1-4';
                 break;
             default:
                 $classes[] = 'wf-1';
         }
     } else {
         $tag = 'blockquote';
         $autop = true;
         $classes[] = 'shortcode-blockquote';
         if ('fancy' == $background) {
             $classes[] = 'block-style-widget';
         }
     }
     $classes = implode(' ', $classes);
     $output = sprintf('<%1$s class="%2$s">%3$s</%1$s>', $tag, esc_attr($classes), presscore_remove_wpautop($content, $autop));
     return $output;
 }
开发者ID:10asfar,项目名称:WordPress-the7-theme-demo-,代码行数:49,代码来源:quote.php

示例6: get_container_html_class

 protected function get_container_html_class($custom_class = '')
 {
     $class = array();
     if ($custom_class) {
         $class[] = $custom_class;
     }
     switch ($this->atts['style']) {
         case '3':
             $class[] = 'br-standard';
         case '2':
             $class[] = 'borderframe';
     }
     switch ($this->atts['align']) {
         case 'left':
             $class[] = 'alignleft';
             break;
         case 'right':
             $class[] = 'alignright';
             break;
         case 'centre':
         case 'center':
             $class[] = 'alignnone';
             break;
     }
     if (presscore_shortcode_animation_on($this->atts['animation'])) {
         $class[] = presscore_get_shortcode_animation_html_class($this->atts['animation']);
     }
     if ($this->content) {
         $class[] = 'caption-on';
     }
     $image_src = $this->choose_src_responsively($this->atts['image'], $this->atts['hd_image']);
     $video_url = $this->atts['media'];
     $lightbox = $this->atts['lightbox'];
     if ($image_src && $video_url && !$lightbox || !$image_src && $video_url) {
         $class[] = 'shortcode-single-video';
     }
     return 'class="' . esc_attr(implode(' ', $class)) . '"';
 }
开发者ID:armslee,项目名称:wp_requid,代码行数:38,代码来源:fancy-image.php

示例7: get_button_class

 protected function get_button_class()
 {
     $classes = array();
     switch ($this->atts['size']) {
         case 'small':
             $classes[] = 'dt-btn-s';
             break;
         case 'medium':
             $classes[] = 'dt-btn-m';
             break;
         case 'big':
             $classes[] = 'dt-btn-l';
             break;
     }
     switch ($this->atts['style']) {
         case 'light':
             $classes[] = 'dt-btn';
             $classes[] = 'btn-light';
             break;
         case 'link':
             $classes[] = 'btn-link';
             break;
         case 'default':
             $classes[] = 'dt-btn';
             break;
     }
     if (presscore_shortcode_animation_on($this->atts['animation'])) {
         $classes[] = presscore_get_shortcode_animation_html_class($this->atts['animation']);
         $classes[] = 'animation-builder';
     }
     if ($this->atts['icon'] && 'right' == $this->atts['icon_align']) {
         $classes[] = 'ico-right-side';
     }
     if ($this->atts['el_class']) {
         $classes[] = $this->atts['el_class'];
     }
     return implode(' ', $classes);
 }
开发者ID:RDePoppe,项目名称:luminaterealestate,代码行数:38,代码来源:button.php

示例8: shortcode

 public function shortcode($atts, $content = null)
 {
     $default_atts = array('style' => '1', 'image' => '', 'image_alt' => '', 'hd_image' => '', 'media' => '', 'padding' => '0', 'align' => '', 'animation' => 'none', 'width' => '');
     $attributes = shortcode_atts($default_atts, $atts);
     // $attributes['type'] = in_array( $attributes['type'], array('image', 'video') ) ?  $attributes['type'] : $default_atts['type'];
     $attributes['style'] = sanitize_key($attributes['style']);
     $attributes['align'] = sanitize_key($attributes['align']);
     $attributes['padding'] = intval($attributes['padding']);
     $attributes['width'] = absint($attributes['width']);
     $attributes['image'] = esc_url($attributes['image']);
     $attributes['image_alt'] = esc_attr($attributes['image_alt']);
     $attributes['hd_image'] = esc_url($attributes['hd_image']);
     $attributes['media'] = esc_url($attributes['media']);
     // $attributes['lightbox'] = apply_filters('dt_sanitize_flag', $attributes['lightbox']);
     $container_classes = array('shortcode-single-image-wrap');
     $media_classes = array('shortcode-single-image');
     $container_style = array();
     $media = '';
     $content_block = '';
     $content = strip_shortcodes($content);
     $attributes['type'] = 'video';
     $attributes['lightbox'] = 1;
     switch ($attributes['style']) {
         case '3':
             $container_classes[] = 'br-standard';
         case '2':
             $container_classes[] = 'borderframe';
             $style = ' style="padding: ' . esc_attr($attributes['padding']) . 'px"';
             break;
         default:
             $style = '';
     }
     switch ($attributes['align']) {
         case 'left':
             $container_classes[] = 'alignleft';
             break;
         case 'right':
             $container_classes[] = 'alignright';
             break;
         case 'centre':
         case 'center':
             $container_classes[] = 'alignnone';
             break;
     }
     if (presscore_shortcode_animation_on($attributes['animation'])) {
         $container_classes[] = presscore_get_shortcode_animation_html_class($attributes['animation']);
     }
     if ($content) {
         $container_classes[] = 'caption-on';
         $content_block = '<div class="shortcode-single-caption">' . $content . '</div>';
     }
     $default_image_src = $attributes['image'] ? $attributes['image'] : $attributes['hd_image'];
     if (dt_retina_on()) {
         $image_src = dt_is_hd_device() ? $attributes['hd_image'] : $attributes['image'];
     } else {
         $image_src = $attributes['image'];
     }
     if (empty($image_src)) {
         $image_src = $default_image_src;
     }
     $media = sprintf('<img src="%s" alt="%s" />', $image_src, $attributes['image_alt']);
     $media = sprintf('<div class="rollover-video">%s<a class="video-icon dt-single-mfp-popup dt-mfp-item mfp-iframe" href="%s" title="%s" data-dt-img-description="%s"></a></div>', $media, $attributes['media'], $attributes['image_alt'], esc_attr($content));
     if ($media) {
         $media = sprintf('<div class="%s"%s><div class="fancy-media-wrap">%s</div></div>', esc_attr(implode(' ', $media_classes)), $style, $media);
     }
     if ($attributes['width']) {
         $container_style[] = 'width: ' . $attributes['width'] . 'px';
     }
     $output = sprintf('<div class="%s"%s>%s</div>', esc_attr(implode(' ', $container_classes)), $container_style ? ' style="' . esc_attr(implode(';', $container_style)) . '"' : '', $media . $content_block);
     return $output;
 }
开发者ID:10asfar,项目名称:WordPress-the7-theme-demo-,代码行数:71,代码来源:fancy-video-vc.php

示例9: get_container_html_class

 protected function get_container_html_class($custom_class = '')
 {
     $container_classes = array();
     if ($custom_class) {
         $container_classes[] = $custom_class;
     }
     switch ($this->atts['style']) {
         case '1':
             $container_classes[] = 'box-style-table';
             break;
         default:
             $container_classes[] = 'table';
     }
     switch ($this->atts['background']) {
         case 'fancy':
             $container_classes[] = 'shortcode-action-bg';
             $container_classes[] = 'block-style-widget';
             break;
         case 'plain':
             $container_classes[] = 'shortcode-action-bg';
             $container_classes[] = 'plain-bg';
             break;
     }
     /**
      * @deprecated Only for backward compatibility
      */
     if (in_array($this->atts['text_align'], array('center', 'centre'))) {
         $container_classes[] = 'text-centered';
     }
     if (!$this->atts['line']) {
         $container_classes[] = 'no-line';
     }
     if (presscore_shortcode_animation_on($this->atts['animation'])) {
         $container_classes[] = presscore_get_shortcode_animation_html_class($this->atts['animation']);
     }
     return 'class="' . esc_attr(implode(' ', $container_classes)) . '"';
 }
开发者ID:RDePoppe,项目名称:luminaterealestate,代码行数:37,代码来源:call-to-action.php

示例10: shortcode

 public function shortcode($atts, $content = null)
 {
     $default_atts = array('type' => '', 'style' => '1', 'image' => '', 'image_alt' => '', 'image_id' => '', 'image_width' => '', 'image_height' => '', 'misc_link' => '', 'target' => 'blank', 'media' => '', 'background' => 'plain', 'lightbox' => '0', 'content_size' => 'big', 'text_align' => 'left', 'animation' => 'none');
     $attributes = shortcode_atts($default_atts, $atts);
     $attributes['type'] = sanitize_key($attributes['type']);
     $attributes['target'] = sanitize_key($attributes['target']);
     $attributes['style'] = sanitize_key($attributes['style']);
     $attributes['background'] = sanitize_key($attributes['background']);
     $attributes['content_size'] = sanitize_key($attributes['content_size']);
     $attributes['text_align'] = sanitize_key($attributes['text_align']);
     $attributes['image_id'] = absint($attributes['image_id']);
     $attributes['image_alt'] = esc_attr($attributes['image_alt']);
     $attributes['image_width'] = absint($attributes['image_width']);
     $attributes['image_height'] = absint($attributes['image_height']);
     $attributes['misc_link'] = esc_url($attributes['misc_link']);
     $attributes['lightbox'] = apply_filters('dt_sanitize_flag', $attributes['lightbox']);
     $attributes['media'] = esc_url($attributes['media']);
     $container_classes = array('shortcode-teaser');
     $content_classes = array('shortcode-teaser-content');
     $media = '';
     // container classes
     if ('1' == $attributes['style']) {
         $container_classes[] = 'img-full';
     }
     switch ($attributes['background']) {
         case 'fancy':
             $container_classes[] = 'frame-fancy';
         case 'plain':
             $container_classes[] = 'frame-on';
     }
     if (in_array($attributes['text_align'], array('center', 'centre'))) {
         $container_classes[] = 'text-centered';
     }
     // content classes
     switch ($attributes['content_size']) {
         case 'small':
             $content_classes[] = 'text-small';
             break;
         case 'normal':
             $content_classes[] = 'text-normal';
             break;
         case 'big':
         default:
             $content_classes[] = 'text-big';
     }
     if (presscore_shortcode_animation_on($attributes['animation'])) {
         $container_classes[] = presscore_get_shortcode_animation_html_class($attributes['animation']);
     }
     if ('uploaded_image' == $attributes['type']) {
         $attributes['image'] = $attributes['image_id'];
         $attributes['media'] = '';
     } else {
         if ('image' == $attributes['type']) {
             $attributes['media'] = '';
         } else {
             if ('video' == $attributes['type']) {
                 $attributes['image'] = '';
             }
         }
     }
     // if media url is set - do some stuff
     if ($attributes['media']) {
         $container_classes[] = 'shortcode-single-video';
         $media = sprintf('<div class="shortcode-teaser-img"><div class="shortcode-teaser-video">%s</div></div>', dt_get_embed($attributes['media']));
         // if image is set
     } elseif ($attributes['image']) {
         if (is_numeric($attributes['image'])) {
             $image_id = absint($attributes['image']);
             $image_info = wp_get_attachment_image_src($image_id, 'full');
             // get image src
             if (!$image_info) {
                 $image_info = presscore_get_default_image();
             }
             $image_src = $image_info[0];
             // get image alt
             if (empty($attributes['image_alt'])) {
                 $attributes['image_alt'] = esc_attr(get_post_meta($image_id, '_wp_attachment_image_alt', true));
             }
             // get image dimensions
             $attributes['image_width'] = $image_info[1];
             $attributes['image_height'] = $image_info[2];
         } else {
             $image_src = esc_url($attributes['image']);
         }
         // format image dimesions
         $image_dimension_attrs = '';
         if ($attributes['image_width'] > 0 && $attributes['image_height'] > 0) {
             $image_dimension_attrs .= ' width="' . $attributes['image_width'] . '"';
             $image_dimension_attrs .= ' height="' . $attributes['image_height'] . '"';
         }
         $media = sprintf('<img src="%s" alt="%s"%s />', $image_src, $attributes['image_alt'], $image_dimension_attrs);
         if ($attributes['lightbox']) {
             $media = sprintf('<a class="rollover rollover-zoom dt-single-mfp-popup dt-mfp-item mfp-image" href="%s" title="%s" data-dt-img-description="%s">%s</a>', $image_src, esc_attr($attributes['image_alt']), '', $media);
         } else {
             if ($attributes['misc_link']) {
                 $media = sprintf('<a class="rollover" href="%s"%s>%s</a>', $attributes['misc_link'], 'blank' == $attributes['target'] ? ' target="_blank"' : '', $media);
             }
         }
         $media = sprintf('<div class="shortcode-teaser-img">%s</div>', $media);
     }
//.........这里部分代码省略.........
开发者ID:noman90rauf,项目名称:wp-content,代码行数:101,代码来源:shortcode-teasers.php

示例11: render_benefit

 public function render_benefit($attributes, $content = null)
 {
     $image = '';
     if ($attributes['icon_code']) {
         $image = wp_kses($attributes['icon_code'], array('i' => array('class' => array())));
     } else {
         $default_image = null;
         $images = array($attributes['image'], $attributes['hd_image']);
         // get default logo
         foreach ($images as $img) {
             if ($img) {
                 $default_image = $img;
                 break;
             }
         }
         if (!empty($default_image)) {
             if (dt_retina_on()) {
                 $image = dt_is_hd_device() ? $images[1] : $images[0];
             } else {
                 $image = $images[0];
             }
             if (empty($image)) {
                 $image = $default_image;
             }
             // ssl support
             $image = dt_make_image_src_ssl_friendly($image);
             $image_size = '';
             if (!empty($attributes['image_size'])) {
                 $image_size = image_hwstring($attributes['image_size'][0], $attributes['image_size'][1]);
             }
             $image = sprintf('<img src="%s" %s alt="%s" />', $image, $image_size, esc_attr($attributes['image_alt']));
         }
     }
     if ($image) {
         $image_classes = array('benefits-grid-ico');
         if (presscore_shortcode_animation_on($attributes['animation'])) {
             $image_classes[] = presscore_get_shortcode_animation_html_class($attributes['animation']);
         }
         // ninjaaaa!
         $image_classes = esc_attr(implode(' ', $image_classes));
         if ($attributes['image_link']) {
             $image = sprintf('<a href="%s" class="%s"%s>%s</a>', $attributes['image_link'], $image_classes, $attributes['target_blank'] ? ' target="_blank"' : '', $image);
         } else {
             $image = sprintf('<span class="%s">%s</span>', $image_classes, $image);
         }
     }
     $style = empty($attributes['style']) ? '1' : $attributes['style'];
     $title = '';
     if ($attributes['title']) {
         if ($attributes['image_link']) {
             $title = sprintf('<%1$s class="benefit-title"><a href="%2$s"%3$s>%4$s</a></%1$s>', $attributes['header_size'], $attributes['image_link'], $attributes['target_blank'] ? ' target="_blank"' : '', $attributes['title']);
         } else {
             $title = sprintf('<%1$s>%2$s</%1$s>', $attributes['header_size'], $attributes['title']);
         }
     }
     $output = '';
     switch ($style) {
         case '2':
             $output .= '<div class="wf-cell">' . '<div>' . '<div class="text-' . $attributes['content_size'] . '">' . '<div class="wf-table">' . '<div class="wf-td">' . $image . '</div>' . '<div class="wf-td">' . $title . '</div>' . '</div>' . $content . '</div>' . '</div>' . '</div>';
             break;
         case '3':
             $output .= '<div class="wf-cell">' . '<div>' . '<div class="text-' . $attributes['content_size'] . '">' . '<div class="wf-table">' . '<div class="wf-td">' . $image . '</div>' . '<div class="wf-td benefits-inner">' . $title . $content . '</div>' . '</div>' . '</div>' . '</div>' . '</div>';
             break;
         default:
             $output .= '<div class="wf-cell">' . '<div>' . '<div class="text-' . $attributes['content_size'] . '">' . '<div class="line-decoration">' . $image . $title . '</div>' . $content . '</div>' . '</div>' . '</div>';
     }
     return $output;
 }
开发者ID:armslee,项目名称:wp_requid,代码行数:68,代码来源:benefits-vc.php

示例12: shortcode_benefit

 public function shortcode_benefit($atts, $content = null)
 {
     $attributes = shortcode_atts(array('image_link' => '', 'target_blank' => 'true', 'image' => '', 'hd_image' => '', 'header_size' => 'h4', 'title' => '', 'content_size' => 'normal'), $atts);
     $attributes['image_link'] = esc_url($attributes['image_link']);
     $attributes['image'] = esc_url($attributes['image']);
     $attributes['hd_image'] = esc_url($attributes['hd_image']);
     $attributes['header_size'] = in_array($attributes['header_size'], array('h2', 'h3', 'h4', 'h5', 'h6')) ? $attributes['header_size'] : 'h4';
     $attributes['content_size'] = in_array($attributes['content_size'], array('normal', 'small', 'big')) ? $attributes['content_size'] : 'normal';
     $attributes['title'] = wp_kses($attributes['title'], array());
     $attributes['target_blank'] = apply_filters('dt_sanitize_flag', $attributes['target_blank']);
     $image = '';
     $title = '';
     $output = '';
     $default_image = null;
     $images = array($attributes['image'], $attributes['hd_image']);
     // get default logo
     foreach ($images as $img) {
         if ($img) {
             $default_image = $img;
             break;
         }
     }
     if (!empty($default_image)) {
         if (dt_retina_on()) {
             $image = dt_is_hd_device() ? $images[1] : $images[0];
         } else {
             $image = $images[0];
         }
         if (empty($image)) {
             $image = $default_image;
         }
         // ssl support
         $image = dt_make_image_src_ssl_friendly($image);
         $image = sprintf('<img src="%s" alt="" />', $image);
         $image_classes = array('benefits-grid-ico');
         if (presscore_shortcode_animation_on(self::$atts['animation'])) {
             $image_classes[] = presscore_get_shortcode_animation_html_class(self::$atts['animation']);
         }
         // ninjaaaa!
         $image_classes = esc_attr(implode(' ', $image_classes));
         if ($attributes['image_link']) {
             $image = sprintf('<a href="%s" class="%s"%s>%s</a>', $attributes['image_link'], $image_classes, $attributes['target_blank'] ? ' target="_blank"' : '', $image);
         } else {
             $image = sprintf('<span class="%s">%s</span>', $image_classes, $image);
         }
     }
     if ($attributes['title']) {
         $title = sprintf('<%1$s>%2$s</%1$s>', $attributes['header_size'], $attributes['title']);
     }
     $style = '1';
     $column = '4';
     $dividers = ' class="borders"';
     if (!empty(self::$atts)) {
         $style = self::$atts['style'];
         $column = self::$atts['columns'];
         $dividers = !self::$atts['dividers'] ? $dividers = '' : $dividers;
     }
     switch ($column) {
         case '1':
             $column_class = 'wf-1';
             break;
         case '2':
             $column_class = 'wf-1-2';
             break;
         case '3':
             $column_class = 'wf-1-3';
             break;
         case '5':
             $column_class = 'wf-1-5';
             break;
         default:
             $column_class = 'wf-1-4';
     }
     switch ($style) {
         case '2':
             $output = sprintf('<div class="wf-cell %s"><div%s><div class="text-%s"><div class="wf-table"><div class="wf-td">%s</div><div class="wf-td">%s</div></div>%s</div></div></div>', $column_class, $dividers, $attributes['content_size'], $image, $title, do_shortcode(wpautop($content)));
             break;
         case '3':
             $output = sprintf('<div class="wf-cell %s"><div%s><div class="text-%s"><div class="wf-table"><div class="wf-td">%s</div><div class="wf-td benefits-inner">%s</div></div></div></div></div>', $column_class, $dividers, $attributes['content_size'], $image, $title . do_shortcode(wpautop($content)));
             break;
         default:
             $output = sprintf('<div class="wf-cell %s"><div%s><div class="text-%s">%s</div></div></div>', $column_class, $dividers, $attributes['content_size'], $image . $title . do_shortcode(wpautop($content)));
     }
     return $output;
 }
开发者ID:noman90rauf,项目名称:wp-content,代码行数:85,代码来源:benefits.php

示例13: get_html_class

 protected function get_html_class()
 {
     // static classes
     $classes = array('btn-shortcode');
     // base classes table
     // contains array( 'attribute' => array( 'value' => 'class' ) )
     $att_value_class_table = array('size' => array('small' => 'dt-btn-s', 'medium' => 'dt-btn-m', 'big' => 'dt-btn-l'), 'style' => array('light' => 'dt-btn btn-light', 'outline' => 'dt-btn outline-btn', 'outline_with_bg' => 'dt-btn outline-bg-btn', 'link' => 'btn-link', 'light_with_bg' => 'dt-btn light-bg-btn', 'default' => 'dt-btn'), 'text_color_style' => array('context' => 'title-btn-color', 'default' => 'default-btn-color', 'accent' => 'accent-btn-color', 'custom' => 'custom-btn-color'), 'text_hover_color_style' => array('context' => 'title-btn-hover-color', 'default' => 'default-btn-hover-color', 'accent' => 'accent-btn-hover-color', 'custom' => 'custom-btn-hover-color'), 'bg_color_style' => array('default' => 'default-btn-bg-color', 'accent' => 'accent-btn-bg-color'), 'bg_hover_color_style' => array('default' => 'default-btn-bg-hover-color', 'accent' => 'accent-btn-bg-hover-color'));
     foreach ($att_value_class_table as $att => $values) {
         // if att from table exists - get it's value
         $value = array_key_exists($att, $this->atts) ? $this->atts[$att] : false;
         // if att value mentioned in table - add class from table
         if ($value && array_key_exists($value, $values)) {
             $classes[] = $values[$value];
         }
     }
     // animation
     if (presscore_shortcode_animation_on($this->atts['animation'])) {
         $classes[] = presscore_get_shortcode_animation_html_class($this->atts['animation']);
         $classes[] = 'animation-builder';
     }
     // icon alignment
     if ($this->atts['icon'] && 'right' == $this->atts['icon_align']) {
         $classes[] = 'ico-right-side';
     }
     // smooth scroll
     if ($this->atts['smooth_scroll']) {
         $classes[] = 'anchor-link';
     }
     // custom class
     if ($this->atts['el_class']) {
         $classes[] = $this->atts['el_class'];
     }
     return presscore_esc_implode(' ', $classes);
 }
开发者ID:10asfar,项目名称:WordPress-the7-theme-demo-,代码行数:34,代码来源:button.php


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