本文整理汇总了PHP中FusionCore_Plugin::set_shortcode_defaults方法的典型用法代码示例。如果您正苦于以下问题:PHP FusionCore_Plugin::set_shortcode_defaults方法的具体用法?PHP FusionCore_Plugin::set_shortcode_defaults怎么用?PHP FusionCore_Plugin::set_shortcode_defaults使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FusionCore_Plugin
的用法示例。
在下文中一共展示了FusionCore_Plugin::set_shortcode_defaults方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
/**
* Render the shortcode
*
* @param array $args Shortcode paramters
* @param string $content Content between shortcode
* @return string HTML output
*/
function render($args, $content = '')
{
$defaults = FusionCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'category' => '', 'excerpt' => '35', 'layout' => 'attachments', 'lightbox' => 'yes', 'limit' => '3', 'post_id' => ''), $args);
extract($defaults);
self::$args = $defaults;
$thumbnails = '';
if ($layout == 'attachments') {
$slider = $this->attachments();
$thumbnails = $this->get_attachments_thumbnails();
} else {
if ($layout == 'posts') {
$slider = $this->posts();
} else {
if ($layout == 'posts-with-excerpt') {
$slider = $this->posts_excerpt();
} else {
//$slider = $this->default_layout();
$slider = '';
}
}
}
$slides_html = sprintf('<ul %s>%s</ul>', FusionCore_Plugin::attributes('flexslider-shortcode-slides-container'), $slider);
$html = sprintf('<div %s>%s</div>', FusionCore_Plugin::attributes('flexslider-shortcode'), $slides_html);
if ($layout == 'attachments') {
//$thumbnails_html = sprintf( '<ul class="slides">%s</ul>', $thumbnails );
$thumbnails_html = '';
$html .= sprintf('<div %s>%s</div>', FusionCore_Plugin::attributes('flexslider-shortcode-thumbnails'), $thumbnails_html);
}
$this->flex_counter++;
return $html;
}
示例2: render
/**
* Render the shortcode
* @param array $args Shortcode paramters
* @param string $content Content between shortcode
* @return string HTML output
*/
function render($args, $content = '')
{
global $smof_data;
$defaults = FusionCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'content_align' => 'left', 'margin_top' => '', 'margin_bottom' => '', 'sep_color' => '', 'size' => 1, 'style_tag' => '', 'style_type' => $smof_data['title_style_type']), $args);
if (!$defaults['margin_top'] && isset($smof_data['title_top_margin']) && $smof_data['title_top_margin']) {
$defaults['margin_top'] = $smof_data['title_top_margin'];
}
if (!$defaults['margin_bottom'] && isset($smof_data['title_bottom_margin']) && $smof_data['title_bottom_margin']) {
$defaults['margin_bottom'] = $smof_data['title_bottom_margin'];
}
extract($defaults);
self::$args = $defaults;
if (!$style_type || $style_type == 'default') {
self::$args['style_type'] = $style_type = $smof_data['title_style_type'];
}
if (strpos($style_type, 'underline') !== FALSE || strpos($style_type, 'none') !== FALSE) {
$html = sprintf('<div %s><h%s %s>%s</h%s></div>', FusionCore_Plugin::attributes('title-shortcode'), $size, FusionCore_Plugin::attributes('title-shortcode-heading'), do_shortcode($content), $size);
} else {
if (self::$args['content_align'] == 'right') {
$html = sprintf('<div %s><div %s><div %s></div></div><h%s %s>%s</h%s></div>', FusionCore_Plugin::attributes('title-shortcode'), FusionCore_Plugin::attributes('title-sep-container'), FusionCore_Plugin::attributes('title-shortcode-sep'), $size, FusionCore_Plugin::attributes('title-shortcode-heading'), do_shortcode($content), $size);
} elseif (self::$args['content_align'] == 'center') {
$html = sprintf('<div %s><div %s><div %s></div></div><h%s %s>%s</h%s><div %s><div %s></div></div></div>', FusionCore_Plugin::attributes('title-shortcode'), FusionCore_Plugin::attributes('title-sep-container title-sep-container-left'), FusionCore_Plugin::attributes('title-shortcode-sep'), $size, FusionCore_Plugin::attributes('title-shortcode-heading'), do_shortcode($content), $size, FusionCore_Plugin::attributes('title-sep-container title-sep-container-right'), FusionCore_Plugin::attributes('title-shortcode-sep'));
} else {
$html = sprintf('<div %s><h%s %s>%s</h%s><div %s><div %s></div></div></div>', FusionCore_Plugin::attributes('title-shortcode'), $size, FusionCore_Plugin::attributes('title-shortcode-heading'), do_shortcode($content), $size, FusionCore_Plugin::attributes('title-sep-container'), FusionCore_Plugin::attributes('title-shortcode-sep'));
}
}
return $html;
}
示例3: render_child
/**
* Render the child shortcode
*
* @param array $args Shortcode paramters
* @param string $content Content between shortcode
* @return string HTML output
*/
function render_child($args, $content = '')
{
global $smof_data;
$defaults = FusionCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'delimiter' => '', 'direction' => 'up', 'icon' => '', 'unit' => '', 'unit_pos' => 'suffix', 'value' => '20'), $args);
extract($defaults);
self::$child_args = $defaults;
self::$child_args['value'] = intval($value);
$unit_output = '';
if ($unit) {
$unit_output = sprintf('<span %s>%s</span>', FusionCore_Plugin::attributes('counter-box-shortcode-unit'), $unit);
}
if ($direction == 'up') {
$init_value = 0;
} else {
$init_value = self::$child_args['value'];
}
$counter = sprintf('<span %s>%s</span>', FusionCore_Plugin::attributes('counter-box-shortcode-counter'), $init_value);
$icon_output = '';
if ($icon) {
$icon_output = sprintf('<i %s></i>', FusionCore_Plugin::attributes('counter-box-shortcode-icon'));
}
if ($unit_pos == 'prefix') {
$counter = $icon_output . $unit_output . $counter;
} else {
$counter = $icon_output . $counter . $unit_output;
}
$counter_wrapper = sprintf('<div %s>%s</div>', FusionCore_Plugin::attributes('counter-box-shortcode-counter-container'), $counter);
$content_output = sprintf('<div %s>%s</div>', FusionCore_Plugin::attributes('counter-box-shortcode-content'), do_shortcode($content));
$html = sprintf('<div %s><div %s>%s</div></div>', FusionCore_Plugin::attributes('counter-box-shortcode'), FusionCore_Plugin::attributes('counter-box-container'), $counter_wrapper . $content_output);
return $html;
}
示例4: render
/**
* Render the shortcode
* @param array $args Shortcode paramters
* @param string $content Content between shortcode
* @return string HTML output
*/
function render($args, $content = '')
{
global $smof_data;
$defaults = FusionCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'alignment' => 'center', 'bottom_margin' => '', 'border_size' => $smof_data['separator_border_size'], 'icon' => '', 'icon_circle' => $smof_data['separator_circle'], 'icon_circle_color' => '', 'sep_color' => $smof_data['sep_color'], 'style_type' => 'none', 'top_margin' => '', 'width' => '', 'bottom' => '', 'color' => '', 'style' => '', 'top' => ''), $args);
if ($defaults['icon_circle'] === '0') {
$defaults['icon_circle'] = 'no';
}
if ($defaults['style']) {
$defaults['style_type'] = $defaults['style'];
}
extract($defaults);
self::$args = $defaults;
if ($bottom) {
self::$args['bottom_margin'] = $bottom;
}
if ($color) {
self::$args['sep_color'] = $color;
}
if ($top) {
self::$args['top_margin'] = $top;
if (!$bottom && $defaults['style'] != 'none') {
self::$args['bottom_margin'] = $top;
}
}
if ($icon && $style_type != 'none') {
$icon_insert = sprintf('<span %s><i %s></i></span>', FusionCore_Plugin::attributes('separator-shortcode-icon-wrapper'), FusionCore_Plugin::attributes('separator-shortcode-icon'));
} else {
$icon_insert = '';
}
$html = sprintf('<div %s></div><div %s>%s</div>', FusionCore_Plugin::attributes('fusion-sep-clear'), FusionCore_Plugin::attributes('separator-shortcode'), $icon_insert);
if (self::$args['alignment'] == 'right') {
$html .= sprintf('<div %s></div>', FusionCore_Plugin::attributes('fusion-sep-clear'));
}
return $html;
}
示例5: render
/**
* Render the shortcode
*
* @param array $args Shortcode paramters
* @param string $content Content between shortcode
*
* @return string HTML output
*/
public function render($args, $content = '')
{
$defaults = FusionCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'background_color' => Avada()->settings->get('countdown_background_color'), 'background_image' => Avada()->settings->get('countdown_background_image'), 'background_position' => Avada()->settings->get('countdown_background_position'), 'background_repeat' => Avada()->settings->get('countdown_background_repeat'), 'border_radius' => Avada()->settings->get('countdown_border_radius'), 'counter_box_color' => Avada()->settings->get('countdown_counter_box_color'), 'counter_text_color' => Avada()->settings->get('countdown_counter_text_color'), 'countdown_end' => '2000-01-01 00:00:00', 'dash_titles' => 'short', 'heading_text' => '', 'heading_text_color' => Avada()->settings->get('countdown_heading_text_color'), 'link_text' => '', 'link_text_color' => Avada()->settings->get('countdown_link_text_color'), 'link_target' => Avada()->settings->get('countdown_link_target'), 'link_url' => '', 'show_weeks' => Avada()->settings->get('countdown_show_weeks'), 'subheading_text' => '', 'subheading_text_color' => Avada()->settings->get('countdown_subheading_text_color')), $args);
extract($defaults);
self::$args = $defaults;
$html = sprintf('<div %s>', FusionCore_Plugin::attributes('countdown-shortcode'));
$html .= self::get_styles();
$html .= sprintf('<div %s>', FusionCore_Plugin::attributes('fusion-countdown-heading-wrapper'));
$html .= sprintf('<div %s>%s</div>', FusionCore_Plugin::attributes('fusion-countdown-subheading'), $subheading_text);
$html .= sprintf('<div %s>%s</div>', FusionCore_Plugin::attributes('fusion-countdown-heading'), $heading_text);
$html .= '</div>';
$html .= sprintf('<div %s>', FusionCore_Plugin::attributes('countdown-shortcode-counter-wrapper'));
$dashes = array(array('show' => $show_weeks, 'class' => 'weeks', 'shortname' => __('Weeks', 'fusion-core'), 'longname' => __('Weeks', 'fusion-core')), array('show' => 'yes', 'class' => 'days', 'shortname' => __('Days', 'fusion-core'), 'longname' => __('Days', 'fusion-core')), array('show' => 'yes', 'class' => 'hours', 'shortname' => __('Hrs', 'fusion-core'), 'longname' => __('Hours', 'fusion-core')), array('show' => 'yes', 'class' => 'minutes', 'shortname' => __('Min', 'fusion-core'), 'longname' => __('Minutes', 'fusion-core')), array('show' => 'yes', 'class' => 'seconds', 'shortname' => __('Sec', 'fusion-core'), 'longname' => __('Seconds', 'fusion-core')));
$dash_class = '';
if (!self::$args['counter_box_color'] || self::$args['counter_box_color'] == 'transparent') {
$dash_class = ' fusion-no-bg';
}
for ($i = 0; $i < count($dashes); $i++) {
if ($dashes[$i]['show'] == 'yes') {
$html .= sprintf('<div class="fusion-dash-wrapper %s"><div class="fusion-dash fusion-dash-%s">%s<div class="fusion-digit">0</div><div class="fusion-digit">0</div><div class="fusion-dash-title">%s</div></div></div>', $dash_class, $dashes[$i]['class'], $dashes[$i]['class'] == 'days' ? '<div class="fusion-first-digit fusion-digit">0</div>' : '', $dashes[$i][$dash_titles . 'name']);
}
}
$html .= '</div>';
$html .= sprintf('<div %s>', FusionCore_Plugin::attributes('fusion-countdown-link-wrapper'));
$html .= sprintf('<a %s>%s</a>', FusionCore_Plugin::attributes('countdown-shortcode-link'), $link_text);
$html .= '</div>';
$html .= do_shortcode($content);
$html .= '</div>';
$this->countdown_counter++;
return $html;
}
示例6: render_child
/**
* Render the child shortcode
*
* @param array $args Shortcode paramters
* @param string $content Content between shortcode
* @return string HTML output
*/
function render_child($args, $content = '')
{
global $smof_data;
$defaults = FusionCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'background_color_front' => $smof_data['flip_boxes_front_bg'], 'background_color_back' => $smof_data['flip_boxes_back_bg'], 'border_color' => $smof_data['flip_boxes_border_color'], 'border_radius' => $smof_data['flip_boxes_border_radius'], 'border_size' => $smof_data['flip_boxes_border_size'], 'circle' => '', 'circle_color' => $smof_data['icon_circle_color'], 'circle_border_color' => $smof_data['icon_border_color'], 'icon' => '', 'icon_color' => $smof_data['icon_color'], 'icon_flip' => '', 'icon_rotate' => '', 'icon_spin' => '', 'image' => '', 'image_width' => '35', 'image_height' => '35', 'text_back_color' => $smof_data['flip_boxes_back_text'], 'text_front' => '', 'text_front_color' => $smof_data['flip_boxes_front_text'], 'title_front' => '', 'title_front_color' => $smof_data['flip_boxes_front_heading'], 'title_back' => '', 'title_back_color' => $smof_data['flip_boxes_back_heading'], 'animation_type' => '', 'animation_direction' => 'left', 'animation_speed' => '0.1'), $args);
extract($defaults);
self::$child_args = $defaults;
$style = $icon_output = $title_output = $title_front_output = $title_back_output = '';
if ($image && $image_width && $image_height) {
$icon_output = sprintf('<img src="%s" width="%s" height="%s" />', $image, $image_width, $image_height);
} else {
if ($icon) {
$icon_output = sprintf('<i %s></i>', FusionCore_Plugin::attributes('flip-box-shortcode-icon'));
}
}
if ($icon_output) {
$icon_output = sprintf('<div %s>%s</div>', FusionCore_Plugin::attributes('flip-box-shortcode-grafix'), $icon_output);
} else {
$icon_output = '';
}
if ($title_front) {
$title_front_output = sprintf('<h2 %s>%s</h2>', FusionCore_Plugin::attributes('flip-box-shortcode-heading-front'), $title_front);
}
if ($title_back) {
$title_back_output = sprintf('<h3 %s>%s</h3>', FusionCore_Plugin::attributes('flip-box-shortcode-heading-back'), $title_back);
}
$front_inner = sprintf('<div %s>%s</div>', FusionCore_Plugin::attributes('flip-box-front-inner'), $icon_output . $title_front_output . $text_front);
$back_inner = sprintf('<div %s>%s</div>', FusionCore_Plugin::attributes('flip-box-back-inner'), $title_back_output . do_shortcode($content));
$front = sprintf('<div %s>%s</div>', FusionCore_Plugin::attributes('flip-box-shortcode-front-box'), $front_inner);
$back = sprintf('<div %s>%s</div>', FusionCore_Plugin::attributes('flip-box-shortcode-back-box'), $back_inner);
$html = sprintf('<div %s><div class="fusion-flip-box"><div %s>%s%s</div></div></div>', FusionCore_Plugin::attributes('flip-box-shortcode'), FusionCore_Plugin::attributes('flip-box-inner-wrapper'), $front, $back);
$this->flipbox_counter++;
return $html;
}
示例7: render
/**
* Render the shortcode
* @param array $args Shortcode paramters
* @param string $content Content between shortcode
* @return string HTML output
*/
function render($args, $content = '')
{
global $smof_data;
$defaults = FusionCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'backgroundcolor' => strtolower($smof_data['tagline_bg']), 'border' => '0px', 'bordercolor' => strtolower($smof_data['tagline_border_color']), 'button' => '', 'buttoncolor' => 'default', 'button_shape' => strtolower($smof_data['button_shape']), 'button_size' => strtolower($smof_data['button_size']), 'button_type' => strtolower($smof_data['button_type']), 'content_alignment' => 'left', 'description' => '', 'highlightposition' => 'left', 'link' => '', 'linktarget' => '_self', 'modal' => '', 'shadow' => 'no', 'shadowopacity' => '0.7', 'title' => '', 'animation_type' => '', 'animation_direction' => 'left', 'animation_speed' => ''), $args);
if ($defaults['modal']) {
$defaults['link'] = '#';
}
$defaults['button_type'] = strtolower($defaults['button_type']);
extract($defaults);
self::$args = $defaults;
$additional_content = '';
$styles = "<style type='text/css'>.reading-box-container-{$this->tagline_box_counter} .element-bottomshadow:before,.reading-box-container-{$this->tagline_box_counter} .element-bottomshadow:after{opacity:{$shadowopacity};}</style>";
if (isset($link) && $link && (isset($button) && $button) && self::$args['content_alignment'] != 'center') {
self::$args['button_class'] = ' continue';
$additional_content = sprintf('<a %s><span>%s</span></a>', FusionCore_Plugin::attributes('tagline-shortcode-button'), $button);
}
if (isset($title) && $title) {
$additional_content .= sprintf('<h2>%s</h2>', $title);
}
if (isset($description) && $description) {
$additional_content .= sprintf('<div class="reading-box-description">%s</div>', $description);
}
if (isset($link) && $link && (isset($button) && $button) && self::$args['content_alignment'] == 'center') {
self::$args['button_class'] = ' continue';
$additional_content .= sprintf('<a %s>%s</a>', FusionCore_Plugin::attributes('tagline-shortcode-button'), $button);
}
if (isset($link) && $link && (isset($button) && $button)) {
self::$args['button_class'] = ' mobile-button';
$additional_content .= sprintf('<a %s><span>%s</span></a>', FusionCore_Plugin::attributes('tagline-shortcode-button'), $button);
}
$html = sprintf('%s<div %s><div %s>%s%s</div></div>', $styles, FusionCore_Plugin::attributes('tagline-shortcode'), FusionCore_Plugin::attributes('tagline-shortcode-reading-box'), $additional_content, do_shortcode($content));
$this->tagline_box_counter++;
return $html;
}
示例8: render
/**
* Render the shortcode
* @param array $args Shortcode paramters
* @param string $content Content between shortcode
* @return string HTML output
*/
function render($args, $content = '')
{
$defaults = FusionCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'link' => ''), $args);
extract($defaults);
self::$args = $defaults;
$html = sprintf('<a %s>%s</a>', FusionCore_Plugin::attributes('one-page-text-link-shortcode'), do_shortcode($content));
return $html;
}
示例9: render
/**
* Render the shortcode
* @param array $args Shortcode paramters
* @param string $content Content between shortcode
* @return string HTML output
*/
function render($args, $content = '')
{
$defaults = FusionCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'animation' => false, 'delay' => 0, 'placement' => 'top', 'title' => 'none', 'trigger' => 'hover'), $args);
extract($defaults);
self::$args = $defaults;
$html = sprintf('<span %s>%s</span>', FusionCore_Plugin::attributes('tooltip-shortcode'), do_shortcode($content));
return $html;
}
示例10: render
/**
* Render the shortcode
* @param array $args Shortcode paramters
* @param string $content Content between shortcode
* @return string HTML output
*/
function render($args, $content = '')
{
global $smof_data;
$defaults = FusionCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'color' => $smof_data['primary_color'], 'rounded' => 'no'), $args);
extract($defaults);
self::$args = $defaults;
$html = sprintf('<span %s>%s</span>', FusionCore_Plugin::attributes('highlight-shortcode'), do_shortcode($content));
return $html;
}
示例11: render
/**
* Render the shortcode
* @param array $args Shortcode paramters
* @param string $content Content between shortcode
* @return string HTML output
*/
function render($args, $content = '')
{
global $woocommerce, $smof_data;
$defaults = FusionCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'cat_slug' => '', 'number_posts' => 10, 'show_cats' => 'yes', 'show_price' => 'yes', 'show_buttons' => 'yes', 'picture_size' => 'fixed'), $args);
extract($defaults);
self::$args = $defaults;
$html = '';
$buttons = '';
if (class_exists('Woocommerce')) {
$number_posts = (int) $number_posts;
$args = array('post_type' => 'product', 'posts_per_page' => $number_posts, 'meta_query' => array(array('key' => '_thumbnail_id', 'compare' => '!=', 'value' => null)));
if ($cat_slug) {
$cat_id = explode(',', $cat_slug);
$args['tax_query'] = array(array('taxonomy' => 'product_cat', 'field' => 'slug', 'terms' => $cat_id));
}
$css_class = 'simple-products-slider';
if ($picture_size != 'fixed') {
$css_class = 'simple-products-slider-variable';
}
$products = new WP_Query($args);
$products_wrapper = $product = '';
if ($products->have_posts()) {
while ($products->have_posts()) {
$products->the_post();
$image = $price_tag = $terms = '';
if (has_post_thumbnail()) {
if ($smof_data['image_rollover']) {
$image = get_the_post_thumbnail(get_the_ID(), 'shop_catalog');
} else {
$image = sprintf('<a href="%s">%s</a>', get_permalink(get_the_ID()), get_the_post_thumbnail(get_the_ID(), 'shop_catalog'));
}
if ($show_cats == 'yes') {
$terms = get_the_term_list(get_the_ID(), 'product_cat', sprintf('<span %s>', FusionCore_Plugin::attributes('cats')), ', ', '</span>');
}
ob_start();
woocommerce_get_template('loop/price.php');
$price = ob_get_contents();
ob_end_clean();
if ($price && $show_price == 'yes') {
$price_tag = $price;
}
if ($show_buttons == 'yes') {
ob_start();
woocommerce_get_template('loop/add-to-cart.php');
$cart_button = ob_get_contents();
ob_end_clean();
$buttons = sprintf('<div %s>%s<a href="%s" %s>%s</a></div>', FusionCore_Plugin::attributes('product-buttons'), $cart_button, get_permalink(), FusionCore_Plugin::attributes('show-details-button'), __('Details', 'Avada'));
}
$product .= sprintf('<li><div %s aria-haspopup="true">%s<div %s><div %s><h2><a href="%s">%s</a></h2>%s%s%s</div></div></div></li>', FusionCore_Plugin::attributes('woo-product-slider-shortcode-img-div'), $image, FusionCore_Plugin::attributes('image-extras'), FusionCore_Plugin::attributes('image-extras-content'), get_permalink(), get_the_title(), $terms, $price_tag, $buttons);
}
}
$products_wrapper = sprintf('<ul>%s</ul>', $product);
}
$html = sprintf('<div %s><div %s><div %s><div %s>%s</div><div %s><span %s></span><span %s></span></div></div></div><div class="fusion-clearfix"></div></div>', FusionCore_Plugin::attributes('woo-product-slider-shortcode'), FusionCore_Plugin::attributes($css_class . ' simple-products-slider'), FusionCore_Plugin::attributes('es-carousel-wrapper fusion-carousel-large'), FusionCore_Plugin::attributes('es-carousel'), $products_wrapper, FusionCore_Plugin::attributes('es-nav'), FusionCore_Plugin::attributes('es-nav-prev'), FusionCore_Plugin::attributes('es-nav-next'));
}
return $html;
}
示例12: render
/**
* Render the shortcode
* @param array $args Shortcode paramters
* @param string $content Content between shortcode
* @return string HTML output
*/
function render($args, $content = '')
{
global $smof_data;
$defaults = FusionCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'boxed' => '', 'boxed_radius' => '', 'color' => strtolower($smof_data['dropcap_color'])), $args);
extract($defaults);
self::$args = $defaults;
$html = sprintf('<span %s>%s</span>', FusionCore_Plugin::attributes('dropcap-shortcode'), do_shortcode($content));
return $html;
}
示例13: render
/**
* Render the shortcode
*
* @param array $args Shortcode paramters
* @param string $content Content between shortcode
* @return string HTML output
*/
function render($args, $content = '')
{
global $smof_data;
$defaults = FusionCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'backgroundattachment' => 'scroll', 'backgroundcolor' => $smof_data['full_width_bg_color'], 'backgroundimage' => '', 'backgroundposition' => 'left top', 'backgroundrepeat' => 'no-repeat', 'bordercolor' => $smof_data['full_width_border_color'], 'bordersize' => $smof_data['full_width_border_size'], 'borderstyle' => 'solid', 'equal_height_columns' => 'no', 'fade' => 'no', 'hundred_percent' => 'no', 'menu_anchor' => '', 'overlay_color' => '', 'overlay_opacity' => '0.5', 'paddingbottom' => '20px', 'paddingleft' => '0px', 'paddingright' => '0px', 'paddingtop' => '20px', 'paddingBottom' => '', 'paddingTop' => '', 'video_loop' => 'yes', 'video_mp4' => '', 'video_mute' => 'yes', 'video_ogv' => '', 'video_preview_image' => '', 'video_webm' => ''), $args);
if ($defaults['hundred_percent'] == 'yes') {
$defaults['paddingleft'] = '0px';
$defaults['paddingright'] = '0px';
}
extract($defaults);
self::$args = $defaults;
$this->depracted_args();
$outer_html = '';
self::$bg_type = 'image';
if ($video_mp4 || $video_ogv || $video_webm) {
self::$bg_type = 'video';
}
if ($fade == 'yes') {
self::$bg_type = 'faded';
$outer_html .= sprintf('<div %s></div>', FusionCore_Plugin::attributes('fullwidth-faded'));
}
if (self::$bg_type == 'video') {
$video_attributes = 'preload="auto" autoplay';
$video_src = '';
if ($video_loop == 'yes') {
$video_attributes .= ' loop';
}
if ($video_mute == 'yes') {
$video_attributes .= ' muted';
}
if ($video_mp4) {
$video_src .= sprintf('<source src="%s" type="video/mp4">', $video_mp4);
}
if ($video_ogv) {
$video_src .= sprintf('<source src="%s" type="video/ogg">', $video_ogg);
}
if ($video_webm) {
$video_src .= sprintf('<source src="%s" type="video/webm">', $video_webm);
}
if ($overlay_color) {
$outer_html .= sprintf('<div %s></div>', FusionCore_Plugin::attributes('fullwidth-overlay'));
}
$outer_html .= sprintf('<div class="%s"><video %s>%s</video></div>', 'fullwidth-video', $video_attributes, $video_src);
if ($video_preview_image) {
$video_preview_image_style = sprintf('background-image:url(%s);', $video_preview_image);
$outer_html .= sprintf('<div class="%s" style="%s"></div>', 'fullwidth-video-image', $video_preview_image_style);
}
}
if ($defaults['menu_anchor']) {
$html = sprintf('<div id="%s"><div %s>%s<div %s>%s</div></div></div>', $defaults['menu_anchor'], FusionCore_Plugin::attributes('fullwidth-shortcode'), $outer_html, FusionCore_Plugin::attributes('avada-row'), do_shortcode($content));
} else {
$html = sprintf('<div %s>%s<div %s>%s</div></div>', FusionCore_Plugin::attributes('fullwidth-shortcode'), $outer_html, FusionCore_Plugin::attributes('avada-row'), do_shortcode($content));
}
return $html;
}
示例14: render_child
/**
* Render the child shortcode
* @param array $args Shortcode paramters
* @param string $content Content between shortcode
* @return string HTML output
*/
function render_child($args, $content = '')
{
$defaults = FusionCore_Plugin::set_shortcode_defaults(array('alt' => '', 'image' => '', 'link' => '', 'linktarget' => '_self'), $args);
extract($defaults);
self::$child_args = $defaults;
$output = sprintf('<img src="%s" alt="%s" />', $image, $alt);
if ($link) {
$output = sprintf('<a href="%s" target="%s">%s</a>', $link, $linktarget, $output);
}
$html = sprintf('<li><div %s>%s</div></li>', FusionCore_Plugin::attributes('image'), $output);
return $html;
}
示例15: render
/**
* Render the shortcode
* @param array $args Shortcode paramters
* @param string $content Content between shortcode
* @return string HTML output
*/
function render($args, $content = '')
{
$defaults = FusionCore_Plugin::set_shortcode_defaults(array('class' => '', 'api_params' => '', 'autoplay' => "false", 'center' => 'no', 'height' => 360, 'id' => '', 'width' => 600), $args);
extract($defaults);
self::$args = $defaults;
if ($autoplay == 'true' || $autoplay == 'yes') {
$autoplay = '&autoplay=1';
} else {
$autoplay = '';
}
$html = sprintf('<div %s><div %s><iframe title="YouTube video player" src="http://www.youtube.com/embed/%s?wmode=transparent%s%s" width="%s" height="%s" frameborder="0" allowfullscreen></iframe></div></div>', FusionCore_Plugin::attributes('youtube-shortcode'), FusionCore_Plugin::attributes('youtube-shortcode-video-sc'), $id, $autoplay, $api_params, $width, $height);
return $html;
}