/** * The get_custom_post function gets a custom post based on a post title. if no post cold be found it creates one * @param string $post_title the title of the post * @package AviaFramework */ public static function get_custom_post($post_title) { $save_title = AviaHelper::save_string($post_title); $args = array('post_type' => 'avia_framework_post', 'post_title' => 'avia_' . $save_title, 'post_status' => 'draft', 'comment_status' => 'closed', 'ping_status' => 'closed'); $avia_post = get_page_by_title($args['post_title'], 'ARRAY_A', 'avia_framework_post'); if (!isset($avia_post['ID'])) { $avia_post_id = wp_insert_post($args); } else { $avia_post_id = $avia_post['ID']; } return $avia_post_id; }
/** * Frontend Shortcode Handler * * @param array $atts array of attributes * @param string $content text within enclosing form of shortcode element * @param string $shortcodename the shortcode found, when == callback name * @return string $output returns the modified html string */ function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "") { $output = ""; $class = ""; $alt = ""; $title = ""; $src = ""; $markup = avia_markup_helper(array('context' => 'image', 'echo' => false, 'custom_markup' => $meta['custom_markup'])); $markup_url = avia_markup_helper(array('context' => 'image_url', 'echo' => false, 'custom_markup' => $meta['custom_markup'])); $hotspots = ShortcodeHelper::shortcode2array($content, 1); extract(shortcode_atts(array('animation' => 'no-animation', 'attachment' => '', 'attachment_size' => '', 'hotspot_layout' => 'numbered', 'hotspot_mobile' => '', 'hotspot_tooltip_display' => ''), $atts, $this->config['shortcode'])); if (!empty($attachment)) { $attachment_entry = get_post($attachment); if (!empty($attachment_entry)) { $alt = get_post_meta($attachment_entry->ID, '_wp_attachment_image_alt', true); $alt = !empty($alt) ? esc_attr($alt) : ''; $title = trim($attachment_entry->post_title) ? esc_attr($attachment_entry->post_title) : ""; if (!empty($attachment_size)) { $src = wp_get_attachment_image_src($attachment_entry->ID, $attachment_size); $src = !empty($src[0]) ? $src[0] : ""; } } } //no src? return if (!empty($src)) { if (!ShortcodeHelper::is_top_level()) { $meta['el_class'] .= " av-non-fullwidth-hotspot-image"; } $hotspot_html = ""; $tooltip_html = ""; $counter = 1; foreach ($hotspots as $hotspot) { if (!empty($hotspot_mobile)) { $tooltip_html .= $this->add_fallback_tooltip($hotspot, $counter); } $extraClass = !empty($hotspot_mobile) ? " av-mobile-fallback-active " : ""; $extraClass .= !empty($hotspot_tooltip_display) ? " {$hotspot_tooltip_display}-single " : ""; $hotspot_html .= $this->add_hotspot($hotspot, $counter, $extraClass); $counter++; } //some custom classes $class .= $animation == "no-animation" ? "" : " avia_animated_image avia_animate_when_almost_visible " . $animation; $class .= " av-hotspot-" . $hotspot_layout; $class .= !empty($hotspot_mobile) ? " av-mobile-fallback-active " : ""; $class .= " " . $hotspot_tooltip_display; $output .= "<div class='av-hotspot-image-container avia_animate_when_almost_visible {$class} " . $meta['el_class'] . " ' {$markup} >"; $output .= "<div class='av-hotspot-container'>"; $output .= "<div class='av-hotspot-container-inner-cell'>"; $output .= "<div class='av-hotspot-container-inner-wrap'>"; $output .= $hotspot_html; $output .= "<img class='avia_image ' src='{$src}' alt='{$alt}' title='{$title}' {$markup_url} />"; $output .= "</div>"; $output .= "</div>"; $output .= "</div>"; $output .= $tooltip_html; $output .= "</div>"; } if (!ShortcodeHelper::is_top_level()) { return $output; } $skipSecond = false; $params['class'] = "main_color av-fullwidth-hotspots " . $meta['el_class']; $params['open_structure'] = false; $params['id'] = !empty($atts['id']) ? AviaHelper::save_string($atts['id'], '-') : ""; $params['custom_markup'] = $meta['custom_markup']; //we dont need a closing structure if the element is the first one or if a previous fullwidth element was displayed before if ($meta['index'] == 0) { $params['close'] = false; } if (!empty($meta['siblings']['prev']['tag']) && in_array($meta['siblings']['prev']['tag'], AviaBuilder::$full_el_no_section)) { $params['close'] = false; } $image = $output; $output = avia_new_section($params); $output .= $image; $output .= "</div>"; //close section //if the next tag is a section dont create a new section from this shortcode if (!empty($meta['siblings']['next']['tag']) && in_array($meta['siblings']['next']['tag'], AviaBuilder::$full_el)) { $skipSecond = true; } //if there is no next element dont create a new section. if (empty($meta['siblings']['next']['tag'])) { $skipSecond = true; } if (empty($skipSecond)) { $output .= avia_new_section(array('close' => false, 'id' => "after_image_hotspots")); } return $output; }
/** * Frontend Shortcode Handler * * @param array $atts array of attributes * @param string $content text within enclosing form of shortcode element * @param string $shortcodename the shortcode found, when == callback name * @return string $output returns the modified html string */ function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "") { $output = ""; $params['class'] = "main_color " . $meta['el_class']; $params['open_structure'] = false; $params['id'] = !empty($atts['id']) ? AviaHelper::save_string($atts['id'], '-') : ""; $params['custom_markup'] = $meta['custom_markup']; if ($atts['gap'] == 'no' && $atts['sort'] == "no" || $meta['index'] == 0) { $params['class'] .= " avia-no-border-styling"; } //we dont need a closing structure if the element is the first one or if a previous fullwidth element was displayed before if ($meta['index'] == 0) { $params['close'] = false; } if (!empty($meta['siblings']['prev']['tag']) && in_array($meta['siblings']['prev']['tag'], AviaBuilder::$full_el_no_section)) { $params['close'] = false; } if ($meta['index'] != 0) { $params['class'] .= " masonry-not-first"; } if ($meta['index'] == 0 && get_post_meta(get_the_ID(), 'header', true) != "no") { $params['class'] .= " masonry-not-first"; } $masonry = new avia_masonry($atts); $masonry->extract_terms(); $masonry->query_entries(); $masonry_html = $masonry->html(); if (!ShortcodeHelper::is_top_level()) { return $masonry_html; } $output .= avia_new_section($params); $output .= $masonry_html; $output .= avia_section_after_element_content($meta, 'after_masonry'); return $output; }
/** * Frontend Shortcode Handler * * @param array $atts array of attributes * @param string $content text within enclosing form of shortcode element * @param string $shortcodename the shortcode found, when == callback name * @return string $output returns the modified html string */ function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "") { avia_sc_section::$section_count++; $atts = shortcode_atts(array('src' => '', 'position' => 'top left', 'repeat' => 'no-repeat', 'attach' => 'scroll', 'color' => 'main_color', 'custom_bg' => '', 'padding' => 'default', 'shadow' => 'shadow', 'id' => '', 'min_height' => '', 'video' => '', 'video_ratio' => '16:9', 'video_mobile_disabled' => '', 'custom_markup' => '', 'attachment' => '', 'attachment_size' => ''), $atts, $this->config['shortcode']); extract($atts); $output = ""; $class = "avia-section " . $color . " avia-section-" . $padding . " avia-" . $shadow . " avia-bg-style-" . $attach; $background = ""; $params['id'] = !empty($id) ? AviaHelper::save_string($id, '-') : "av_section_" . avia_sc_section::$section_count; $params['custom_markup'] = $meta['custom_markup']; if (!empty($attachment) && !empty($attachment_size)) { $attachment_entry = get_post($attachment); if (!empty($attachment_entry)) { if (!empty($attachment_size)) { $src = wp_get_attachment_image_src($attachment_entry->ID, $attachment_size); $src = !empty($src[0]) ? $src[0] : ""; } } } else { $attachment = false; } if ($src != "") { if ($repeat == 'stretch') { $background .= "background-repeat: no-repeat; "; $class .= " avia-full-stretch"; } else { $background .= "background-repeat: {$repeat}; "; } $background .= "background-image: url({$src}); "; $background .= $attach == 'parallax' ? "background-attachment: scroll; " : "background-attachment: {$attach}; "; $background .= "background-position: {$position}; "; if ($attach == 'parallax') { $attachment_class = ""; if ($repeat == 'stretch' || $repeat == 'no-repeat') { $attachment_class .= " avia-full-stretch"; } $class .= " av-parallax-section"; $speed = apply_filters('avf_parallax_speed', "0.3", $params['id']); $params['attach'] = "<div class='av-parallax {$attachment_class}' data-avia-parallax-ratio='{$speed}' style = '{$background}' ></div>"; $background = ""; } $params['data'] = "data-section-bg-repeat='{$repeat}'"; } if ($custom_bg != "") { $background .= "background-color: {$custom_bg}; "; } if ($background) { $background = "style = '{$background}'"; } $params['class'] = $class . " " . $meta['el_class']; $params['bg'] = $background; $params['min_height'] = $min_height; $params['video'] = $video; $params['video_ratio'] = $video_ratio; $params['video_mobile_disabled'] = $video_mobile_disabled; if (isset($meta['index'])) { if ($meta['index'] == 0) { $params['main_container'] = true; } if ($meta['index'] == 0 || isset($meta['siblings']['prev']['tag']) && in_array($meta['siblings']['prev']['tag'], AviaBuilder::$full_el_no_section)) { $params['close'] = false; } } global $avia_config; $avia_config['layout_container'] = "section"; $output .= avia_new_section($params); $output .= ShortcodeHelper::avia_remove_autop($content, true); //if the next tag is a section dont create a new section from this shortcode if (!empty($meta['siblings']['next']['tag']) && in_array($meta['siblings']['next']['tag'], AviaBuilder::$full_el)) { $skipSecond = true; } //if there is no next element dont create a new section. if we got a sidebar always create a next section at the bottom if (empty($meta['siblings']['next']['tag']) && !avia_has_sidebar()) { $skipSecond = true; } if (empty($skipSecond)) { $new_params['id'] = "after_section_" . avia_sc_section::$section_count; $output .= avia_new_section($new_params); } unset($avia_config['layout_container']); return $output; }
/** * Frontend Shortcode Handler * * @param array $atts array of attributes * @param string $content text within enclosing form of shortcode element * @param string $shortcodename the shortcode found, when == callback name * @return string $output returns the modified html string */ function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "") { global $avia_config; avia_sc_section::$section_count++; $atts = shortcode_atts(array('src' => '', 'position' => 'top left', 'repeat' => 'no-repeat', 'attach' => 'scroll', 'color' => 'main_color', 'custom_bg' => '', 'padding' => 'default', 'shadow' => 'shadow', 'id' => '', 'min_height' => '', 'min_height_px' => '', 'video' => '', 'video_ratio' => '16:9', 'video_mobile_disabled' => '', 'custom_markup' => '', 'attachment' => '', 'attachment_size' => '', 'bottom_border' => '', 'overlay_enable' => '', 'overlay_opacity' => '', 'overlay_color' => '', 'overlay_pattern' => '', 'overlay_custom_pattern' => '', 'scroll_down' => ''), $atts, $this->config['shortcode']); extract($atts); $output = ""; $class = "avia-section " . $color . " avia-section-" . $padding . " avia-" . $shadow; $background = ""; $params['id'] = !empty($id) ? AviaHelper::save_string($id, '-') : "av_section_" . avia_sc_section::$section_count; $params['custom_markup'] = $meta['custom_markup']; $params['attach'] = ""; if (!empty($attachment) && !empty($attachment_size)) { $attachment_entry = get_post($attachment); if (!empty($attachment_entry)) { if (!empty($attachment_size)) { $src = wp_get_attachment_image_src($attachment_entry->ID, $attachment_size); $src = !empty($src[0]) ? $src[0] : ""; } } } else { $attachment = false; } if ($custom_bg != "") { $background .= "background-color: {$custom_bg}; "; } /*set background image*/ if ($src != "") { if ($repeat == 'stretch') { $background .= "background-repeat: no-repeat; "; $class .= " avia-full-stretch"; } else { $background .= "background-repeat: {$repeat}; "; } $background .= "background-image: url({$src}); "; $background .= $attach == 'parallax' ? "background-attachment: scroll; " : "background-attachment: {$attach}; "; $background .= "background-position: {$position}; "; if ($attach == 'parallax') { $attachment_class = ""; if ($repeat == 'stretch' || $repeat == 'no-repeat') { $attachment_class .= " avia-full-stretch"; } $class .= " av-parallax-section"; $speed = apply_filters('avf_parallax_speed', "0.3", $params['id']); $params['attach'] .= "<div class='av-parallax' data-avia-parallax-ratio='{$speed}' >"; $params['attach'] .= "<div class='av-parallax-inner {$color} {$attachment_class}' style = '{$background}' >"; $params['attach'] .= "</div>"; $params['attach'] .= "</div>"; $background = ""; } $params['data'] = "data-section-bg-repeat='{$repeat}'"; } else { $attach = "scroll"; } if ($custom_bg != "") { $background .= "background-color: {$custom_bg}; "; } if ($background) { $background = "style = '{$background}'"; } /*check/create overlay*/ $overlay = ""; $pre_wrap = "<div class='av-section-color-overlay-wrap'>"; if (!empty($overlay_enable)) { $overlay_src = ""; $overlay = "opacity: {$overlay_opacity}; "; if (!empty($overlay_color)) { $overlay .= "background-color: {$overlay_color}; "; } if (!empty($overlay_pattern)) { if ($overlay_pattern == "custom") { $overlay_src = $overlay_custom_pattern; } else { $overlay_src = str_replace('{{AVIA_BASE_URL}}', AVIA_BASE_URL, $overlay_pattern); } } if (!empty($overlay_src)) { $overlay .= "background-image: url({$overlay_src}); background-repeat: repeat;"; } $overlay = "<div class='av-section-color-overlay' style='{$overlay}'></div>"; $class .= " av-section-color-overlay-active"; $params['attach'] .= $pre_wrap . $overlay; } if (!empty($scroll_down)) { if (!$overlay) { $params['attach'] .= $pre_wrap; } $params['attach'] .= "<a href='#next-section' title='' class='scroll-down-link' " . av_icon_string('scrolldown') . "></a>"; } $class .= " avia-bg-style-" . $attach; $params['class'] = $class . " " . $meta['el_class']; $params['bg'] = $background; $params['min_height'] = $min_height; $params['min_height_px'] = $min_height_px; $params['video'] = $video; $params['video_ratio'] = $video_ratio; $params['video_mobile_disabled'] = $video_mobile_disabled; if (isset($meta['index'])) { if ($meta['index'] == 0) { $params['main_container'] = true; } if ($meta['index'] == 0 || isset($meta['siblings']['prev']['tag']) && in_array($meta['siblings']['prev']['tag'], AviaBuilder::$full_el_no_section)) { $params['close'] = false; } } $avia_config['layout_container'] = "section"; $output .= avia_new_section($params); $output .= ShortcodeHelper::avia_remove_autop($content, true); /*set extra arrow element*/ if (strpos($bottom_border, 'border-extra') !== false) { $backgroundEl = ""; $backgroundElColor = !empty($custom_bg) ? $custom_bg : $avia_config['backend_colors']['color_set'][$color]['bg']; if ($backgroundElColor) { $backgroundEl = " style='background-color:{$backgroundElColor};' "; } avia_sc_section::$add_to_closing = "<div class='av-extra-border-element {$bottom_border}'><div class='av-extra-border-outer'><div class='av-extra-border-inner' {$backgroundEl}></div></div></div>"; } else { avia_sc_section::$add_to_closing = ""; } //next section needs an extra closing tag if overlay with wrapper was added: if ($overlay || !empty($scroll_down)) { avia_sc_section::$close_overlay = "</div>"; } else { avia_sc_section::$close_overlay = ""; } //if the next tag is a section dont create a new section from this shortcode if (!empty($meta['siblings']['next']['tag']) && in_array($meta['siblings']['next']['tag'], AviaBuilder::$full_el)) { $skipSecond = true; } //if there is no next element dont create a new section. if we got a sidebar always create a next section at the bottom if (empty($meta['siblings']['next']['tag']) && !avia_has_sidebar()) { $skipSecond = true; } if (empty($skipSecond)) { $new_params['id'] = "after_section_" . avia_sc_section::$section_count; $output .= avia_new_section($new_params); } unset($avia_config['layout_container']); return $output; }
/** * Frontend Shortcode Handler * * @param array $atts array of attributes * @param string $content text within enclosing form of shortcode element * @param string $shortcodename the shortcode found, when == callback name * @return string $output returns the modified html string */ function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "") { $output = ""; $skipSecond = false; //check if we got a layerslider global $wpdb; $params['class'] = "main_color " . $meta['el_class']; $params['open_structure'] = false; $params['id'] = !empty($atts['id']) ? AviaHelper::save_string($atts['id'], '-') : ""; //we dont need a closing structure if the element is the first one or if a previous fullwidth element was displayed before if ($meta['index'] == 0) { $params['close'] = false; } if (!empty($meta['siblings']['prev']['tag']) && in_array($meta['siblings']['prev']['tag'], AviaBuilder::$full_el_no_section)) { $params['close'] = false; } if ($meta['index'] != 0) { $params['class'] .= " masonry-not-first"; } if ($meta['index'] == 0 && get_post_meta(get_the_ID(), 'header', true) != "no") { $params['class'] .= " masonry-not-first"; } if ($atts['gap'] == 'no') { $params['class'] .= " avia-no-border-styling"; } $atts['container_class'] = "av-masonry-gallery"; $masonry = new avia_masonry($atts); $masonry->query_entries_by_id(); $masonry_html = $masonry->html(); if (!ShortcodeHelper::is_top_level()) { return $masonry_html; } $output .= avia_new_section($params); $output .= $masonry_html; $output .= "</div><!-- close section -->"; //close section //if the next tag is a section dont create a new section from this shortcode if (!empty($meta['siblings']['next']['tag']) && in_array($meta['siblings']['next']['tag'], AviaBuilder::$full_el)) { $skipSecond = true; } //if there is no next element dont create a new section. if (empty($meta['siblings']['next']['tag'])) { $skipSecond = true; } if (empty($skipSecond)) { $output .= avia_new_section(array('close' => false, 'id' => "after_masonry")); } return $output; }
/** * Frontend Shortcode Handler * * @param array $atts array of attributes * @param string $content text within enclosing form of shortcode element * @param string $shortcodename the shortcode found, when == callback name * @return string $output returns the modified html string */ function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "") { $atts['class'] = !empty($meta['custom_class']) ? $meta['custom_class'] : ""; if (current_theme_supports('avia_template_builder_custom_post_type_grid')) { if (isset($atts['link'])) { $atts['link'] = explode(',', $atts['link'], 2); $atts['taxonomy'] = $atts['link'][0]; if (isset($atts['link'][1])) { $atts['categories'] = $atts['link'][1]; } } if (empty($atts['post_type']) || !current_theme_supports('add_avia_builder_post_type_option')) { $atts['post_type'] = get_post_types(); } if (is_string($atts['post_type'])) { $atts['post_type'] = explode(',', $atts['post_type']); } } $atts['fullscreen'] = ShortcodeHelper::is_top_level(); $grid = new avia_post_grid($atts); $grid->query_entries(); $portfolio_html = $grid->html(); if (!ShortcodeHelper::is_top_level()) { return $portfolio_html; } $params['class'] = "main_color avia-no-border-styling avia-fullwidth-portfolio " . $meta['el_class']; $params['open_structure'] = false; $params['id'] = !empty($atts['id']) ? AviaHelper::save_string($atts['id'], '-') : ""; $params['custom_markup'] = $meta['custom_markup']; //we dont need a closing structure if the element is the first one or if a previous fullwidth element was displayed before if ($meta['index'] == 0) { $params['close'] = false; } if (!empty($meta['siblings']['prev']['tag']) && in_array($meta['siblings']['prev']['tag'], AviaBuilder::$full_el_no_section)) { $params['close'] = false; } $output = avia_new_section($params); $output .= $portfolio_html; $output .= avia_section_after_element_content($meta, 'after_portfolio'); return $output; }
/** * Frontend Shortcode Handler * * @param array $atts array of attributes * @param string $content text within enclosing form of shortcode element * @param string $shortcodename the shortcode found, when == callback name * @return string $output returns the modified html string */ function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "") { avia_sc_section::$section_count++; extract(shortcode_atts(array('src' => '', 'position' => 'top left', 'repeat' => 'no-repeat', 'attach' => 'scroll', 'color' => 'main_color', 'custom_bg' => '', 'padding' => 'default', 'shadow' => 'shadow', 'id' => ''), $atts)); $output = ""; $class = "avia-section " . $color . " avia-section-" . $padding . " avia-" . $shadow; $background = ""; if ($src != "") { if ($repeat == 'stretch') { $background .= "background-repeat: no-repeat; "; $class .= " avia-full-stretch"; } else { $background .= "background-repeat: {$repeat}; "; } $background .= "background-image: url({$src}); "; $background .= "background-attachment: {$attach}; "; $background .= "background-position: {$position}; "; } if ($custom_bg != "") { $background .= "background-color: {$custom_bg}; "; } if ($background) { $background = "style = '{$background}'"; } $params['class'] = $class . " " . $meta['el_class']; $params['bg'] = $background; $params['id'] = !empty($id) ? AviaHelper::save_string($id, '-') : "av_section_" . avia_sc_section::$section_count; if (isset($meta['index'])) { if ($meta['index'] == 0 || isset($meta['siblings']['prev']['tag']) && in_array($meta['siblings']['prev']['tag'], array('av_layerslider', 'av_slideshow_full', 'av_fullscreen'))) { $params['close'] = false; } } $output .= avia_new_section($params); $output .= ShortcodeHelper::avia_remove_autop($content, true); //if the next tag is a section dont create a new section from this shortcode if (!empty($meta['siblings']['next']['tag']) && in_array($meta['siblings']['next']['tag'], array('av_layerslider', 'av_section', 'av_slideshow_full', 'av_fullscreen'))) { $skipSecond = true; } //if there is no next element dont create a new section. if we got a sidebar always create a next section at the bottom if (empty($meta['siblings']['next']['tag']) && !avia_has_sidebar()) { $skipSecond = true; } if (empty($skipSecond)) { $new_params['id'] = "after_section_" . avia_sc_section::$section_count; $output .= avia_new_section($new_params); } return $output; }
/** * Frontend Shortcode Handler * * @param array $atts array of attributes * @param string $content text within enclosing form of shortcode element * @param string $shortcodename the shortcode found, when == callback name * @return string $output returns the modified html string */ function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "") { avia_sc_button_full::$count++; $atts = shortcode_atts(array('label' => 'Click me', 'link' => '', 'link_target' => '', 'color' => 'theme-color', 'color_hover' => 'theme-color-subtle', 'custom_bg' => '#444444', 'custom_bg_hover' => '#444444', 'custom_font' => '#ffffff', 'position' => 'center', 'icon_select' => 'no', 'icon' => '', 'font' => '', 'icon_hover' => '', 'description_pos' => ''), $atts, $this->config['shortcode']); $display_char = av_icon($atts['icon'], $atts['font']); $style = "color:" . $atts['custom_font'] . "; "; $style_hover = ""; if ($atts['color'] == "custom") { $style .= "background-color:" . $atts['custom_bg'] . "; "; } if ($atts['color_hover'] == "custom") { $style_hover = "style='background-color:" . $atts['custom_bg_hover'] . "; '"; } $extraClass = $atts['icon_hover'] ? "av-icon-on-hover" : ""; $blank = strpos($atts['link_target'], '_blank') !== false ? ' target="_blank" ' : ""; $blank .= strpos($atts['link_target'], 'nofollow') !== false ? ' rel="nofollow" ' : ""; $link = AviaHelper::get_url($atts['link']); $link = $link == "http://" ? "" : $link; if ($style) { $style = "style='{$style}'"; } $content_html = ""; if ($content && $atts['description_pos'] == 'above') { $content_html .= "<div class='av-button-description av-button-description-above'>" . ShortcodeHelper::avia_apply_autop(ShortcodeHelper::avia_remove_autop($content)) . "</div>"; } if ('yes-left-icon' == $atts['icon_select']) { $content_html .= "<span class='avia_button_icon avia_button_icon_left ' {$display_char}></span>"; } $content_html .= "<span class='avia_iconbox_title' >" . $atts['label'] . "</span>"; if ('yes-right-icon' == $atts['icon_select']) { $content_html .= "<span class='avia_button_icon avia_button_icon_right' {$display_char}></span>"; } if ($content && $atts['description_pos'] == 'below') { $content_html .= "<div class='av-button-description av-button-description-below'>" . ShortcodeHelper::avia_apply_autop(ShortcodeHelper::avia_remove_autop($content)) . "</div>"; } $output = ""; $output .= "<a href='{$link}' class='avia-button avia-button-fullwidth {$extraClass} " . $this->class_by_arguments('icon_select, color', $atts, true) . "' {$blank} {$style} >"; $output .= $content_html; $output .= "<span class='avia_button_background avia-button avia-button-fullwidth avia-color-" . $atts['color_hover'] . "' {$style_hover}></span>"; $output .= "</a>"; $output = "<div class='avia-button-wrap avia-button-" . $atts['position'] . " " . $meta['el_class'] . "'>" . $output . "</div>"; $params['class'] = "main_color av-fullscreen-button avia-no-border-styling " . $meta['el_class']; $params['open_structure'] = false; $id = AviaHelper::save_string($atts['label'], '-'); $params['id'] = !empty($id) ? $id : "av-fullwidth-button-" . avia_sc_button_full::$count; $params['custom_markup'] = $meta['custom_markup']; //we dont need a closing structure if the element is the first one or if a previous fullwidth element was displayed before if ($meta['index'] == 0) { $params['close'] = false; } if (!empty($meta['siblings']['prev']['tag']) && in_array($meta['siblings']['prev']['tag'], AviaBuilder::$full_el_no_section)) { $params['close'] = false; } if (!ShortcodeHelper::is_top_level()) { return $output; } $button_html = $output; $output = avia_new_section($params); $output .= $button_html; $output .= avia_section_after_element_content($meta, 'after_fullwidth_button'); return $output; return $output; }