/** * 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 = shortcode_atts(array('label' => 'Click me', 'link' => '', 'link_target' => '', 'color' => 'theme-color', 'custom_bg' => '#444444', 'custom_font' => '#ffffff', 'size' => 'small', 'position' => 'center', 'icon_select' => 'yes', 'icon' => '', 'font' => '', 'icon_hover' => ''), $atts, $this->config['shortcode']); $display_char = av_icon($atts['icon'], $atts['font']); $extraClass = $atts['icon_hover'] ? "av-icon-on-hover" : ""; if ($atts['icon_select'] == "yes") { $atts['icon_select'] = "yes-left-icon"; } $style = ""; if ($atts['color'] == "custom") { $style .= "style='background-color:" . $atts['custom_bg'] . "; border-color:" . $atts['custom_bg'] . "; color:" . $atts['custom_font'] . "; '"; } $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; $content_html = ""; 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>"; } $output = ""; $output .= "<a href='{$link}' class='avia-button {$extraClass} " . $this->class_by_arguments('icon_select, color, size, position', $atts, true) . "' {$blank} {$style} >"; $output .= $content_html; $output .= "</a>"; $output = "<div class='avia-button-wrap avia-button-" . $atts['position'] . " " . $meta['el_class'] . "'>" . $output . "</div>"; 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 = "") { extract(shortcode_atts(array('position' => 'left', 'bar_styling' => 'av-striped-bar', 'bar_animation' => 'av-animated-bar'), $atts, $this->config['shortcode'])); $bars = ShortcodeHelper::shortcode2array($content); $extraClass = $bar_styling . " " . $bar_animation; $output = ""; if (!empty($bars)) { $output .= "<div class='avia-progress-bar-container avia_animate_when_almost_visible " . $meta['el_class'] . " {$extraClass}'>"; $defaults = array('color' => 'theme-color', 'progress' => "100", 'title' => "", 'icon' => '', 'font' => '', "icon_select" => "no"); foreach ($bars as $bar) { $bar['attr'] = array_merge($defaults, $bar['attr']); $display_char = av_icon($bar['attr']['icon'], $bar['attr']['font']); $output .= "<div class='avia-progress-bar " . $bar['attr']['color'] . "-bar icon-bar-" . $bar['attr']['icon_select'] . "'>"; if ($bar['attr']['icon_select'] == "yes" || $bar['attr']['title']) { $output .= "<div class='progressbar-title-wrap'>"; $output .= "<div class='progressbar-icon'><span class='progressbar-char' {$display_char}></span></div>"; $output .= "<div class='progressbar-title'>" . $bar['attr']['title'] . "</div>"; $output .= "</div>"; } $output .= "<div class='progress'><div class='bar-outer'><div class='bar' style='width: " . $bar['attr']['progress'] . "%' data-progress='" . $bar['attr']['progress'] . "'></div></div></div>"; $output .= "</div>"; } $output .= "</div>"; } 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 = "") { extract(shortcode_atts(array('title' => 'Title', 'icon' => '1', 'position' => 'left', 'link' => '', 'linktarget' => 'no', 'linkelement' => '', 'font' => ''), $atts)); $display_char = av_icon($icon, $font); $display_char_wrapper = array(); if ($position == 'top') { $position .= " main_color"; } $blank = strpos($linktarget, '_blank') !== false || $linktarget == 'yes' ? ' target="_blank" ' : ""; $blank .= strpos($linktarget, 'nofollow') !== false ? ' rel="nofollow" ' : ""; $link = aviaHelper::get_url($link); if (!empty($link)) { $linktitle = $title; switch ($linkelement) { case 'both': $title = "<a href='{$link}' title='" . esc_attr($linktitle) . "' {$blank}>{$linktitle}</a>"; $display_char_wrapper['start'] = "a href='{$link}' title='" . esc_attr($linktitle) . "' {$blank}"; $display_char_wrapper['end'] = 'a'; break; case 'only_icon': $display_char_wrapper['start'] = "a href='{$link}' title='" . esc_attr($linktitle) . "' {$blank}"; $display_char_wrapper['end'] = 'a'; break; default: $title = "<a href='{$link}' title='" . esc_attr($linktitle) . "' {$blank}>{$linktitle}</a>"; $display_char_wrapper['start'] = 'div'; $display_char_wrapper['end'] = 'div'; break; } } if (empty($display_char_wrapper)) { $display_char_wrapper['start'] = 'div'; $display_char_wrapper['end'] = 'div'; } // add blockquotes to the content $markup = avia_markup_helper(array('context' => 'entry', 'echo' => false)); $output = '<article class="iconbox iconbox_' . $position . ' ' . $meta['el_class'] . '" ' . $markup . '>'; $output .= ' <div class="iconbox_content">'; $output .= ' <header class="entry-content-header">'; $output .= ' <' . $display_char_wrapper['start'] . ' class="iconbox_icon heading-color" ' . $display_char . '></' . $display_char_wrapper['end'] . '>'; $markup = avia_markup_helper(array('context' => 'entry_title', 'echo' => false)); $output .= " <h3 class='iconbox_content_title' {$markup}>" . $title . "</h3>"; $output .= ' </header>'; $markup = avia_markup_helper(array('context' => 'entry_content', 'echo' => false)); $output .= " <div class='iconbox_content_container' {$markup}>"; $output .= ShortcodeHelper::avia_apply_autop(ShortcodeHelper::avia_remove_autop($content)); $output .= ' </div>'; $output .= ' </div>'; $output .= ' <footer class="entry-footer"></footer>'; $output .= '</article>'; return $output; }
function av_iconlist_item($atts, $content = "", $shortcodename = "") { $atts = shortcode_atts(array('title' => '', 'link' => '', 'icon' => '', 'font' => '', 'linkelement' => '', 'linktarget' => ''), $atts); $display_char = av_icon($atts['icon'], $atts['font']); $display_char_wrapper = array(); $blank = strpos($atts['linktarget'], '_blank') !== false || $atts['linktarget'] == 'yes' ? ' target="_blank" ' : ""; $blank .= strpos($atts['linktarget'], 'nofollow') !== false ? ' rel="nofollow" ' : ""; if (!empty($atts['link'])) { $atts['link'] = aviaHelper::get_url($atts['link']); if (!empty($atts['link'])) { $linktitle = $atts['title']; switch ($atts['linkelement']) { case 'both': $atts['title'] = "<a href='{$atts['link']}' title='" . esc_attr($linktitle) . "'{$blank}>{$linktitle}</a>"; $display_char_wrapper['start'] = "a href='{$atts['link']}' title='" . esc_attr($linktitle) . "' {$blank}"; $display_char_wrapper['end'] = 'a'; break; case 'only_icon': $display_char_wrapper['start'] = "a href='{$atts['link']}' title='" . esc_attr($linktitle) . "' {$blank}"; $display_char_wrapper['end'] = 'a'; break; default: $atts['title'] = "<a href='{$atts['link']}' title='" . esc_attr($linktitle) . "'{$blank}>{$linktitle}</a>"; $display_char_wrapper['start'] = 'div'; $display_char_wrapper['end'] = 'div'; break; } } } if (empty($display_char_wrapper)) { $display_char_wrapper['start'] = 'div'; $display_char_wrapper['end'] = 'div'; } $output = ""; $output .= "<li>"; $output .= "<{$display_char_wrapper['start']} class='iconlist_icon avia-font-" . $atts['font'] . "'><span class='iconlist-char' {$display_char}></span></{$display_char_wrapper['end']}>"; $output .= '<article class="article-icon-entry" ' . avia_markup_helper(array('context' => 'entry', 'echo' => false)) . '>'; $output .= "<div class='iconlist_content_wrap'>"; $output .= '<header class="entry-content-header">'; $markup = avia_markup_helper(array('context' => 'entry_title', 'echo' => false)); $output .= "<h4 class='iconlist_title' {$markup}>" . $atts['title'] . "</h4>"; $output .= '</header>'; $markup = avia_markup_helper(array('context' => 'entry_content', 'echo' => false)); $output .= "<div class='iconlist_content' {$markup}>" . ShortcodeHelper::avia_apply_autop(ShortcodeHelper::avia_remove_autop($content)) . "</div>"; $output .= "</div>"; $output .= '<footer class="entry-footer"></footer>'; $output .= '</article>'; $output .= "<div class='iconlist-timeline'></div>"; $output .= "</li>"; 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 = shortcode_atts(array('title' => '', 'color' => 'green', 'border' => '', 'custom_bg' => '#444444', 'custom_font' => '#ffffff', 'size' => 'large', 'icon_select' => 'yes', 'icon' => '', 'font' => ''), $atts, $this->config['shortcode']); $display_char = av_icon($atts['icon'], $atts['font']); $output = ""; $style = ""; if ($atts['color'] == "custom") { $style .= "style='background-color:" . $atts['custom_bg'] . "; color:" . $atts['custom_font'] . "; '"; } $output .= "<div {$style} class='avia_message_box " . $this->class_by_arguments('color, size, icon_select, border', $atts, true) . $meta['el_class'] . "'>"; if ($atts['title']) { $output .= "<span class='avia_message_box_title' >" . $atts['title'] . "</span>"; } $output .= "<div class='avia_message_box_content' >"; if ($atts['icon_select'] == 'yes') { $output .= "<span class='avia_message_box_icon' {$display_char}></span>"; } $output .= ShortcodeHelper::avia_apply_autop(ShortcodeHelper::avia_remove_autop($content)) . "</div>"; $output .= "</div>"; 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 = shortcode_atts(array('name' => '', 'src' => '', 'description' => '', 'job' => '', 'custom_markup' => '', 'font_color' => '', 'custom_title' => '', 'custom_content' => ''), $atts, $this->config['shortcode']); extract($atts); $title_styling = ""; $content_styling = ""; $content_class = ""; $title_class = ""; if ($font_color == "custom") { $title_styling .= !empty($custom_title) ? "color:{$custom_title}; " : ""; $content_styling .= !empty($custom_content) ? "color:{$custom_content}; " : ""; if ($title_styling) { $title_styling = " style='{$title_styling}'"; $title_class = "av_opacity_variation"; } if ($content_styling) { $content_styling = " style='{$content_styling}'"; $content_class = "av_inherit_color"; } } $socials = ShortcodeHelper::shortcode2array($content); $output = ""; $markup = avia_markup_helper(array('context' => 'person', 'echo' => false, 'custom_markup' => $custom_markup)); $output .= "<section class='avia-team-member " . $meta['el_class'] . "' {$markup}>"; if ($src) { $output .= "<div class='team-img-container'>"; $markup = avia_markup_helper(array('context' => 'single_image', 'echo' => false, 'custom_markup' => $custom_markup)); $output .= "<img class='avia_image avia_image_team' src='" . $src . "' alt='" . esc_attr($name) . "' {$markup} />"; if (!empty($socials)) { $output .= "<div class='team-social'>"; $output .= "<div class='team-social-inner'>"; foreach ($socials as $social) { //set defaults $social['attr'] = shortcode_atts(array('link' => '', 'link_target' => '', 'icon' => '', 'font' => '', 'title' => ''), $social['attr'], 'av_social'); //build link for each social item $tooltip = $social['attr']['title'] ? 'data-avia-tooltip="' . $social['attr']['title'] . '"' : ""; $target = $social['attr']['link_target'] ? "target='_blank'" : ""; //apply special class in case its a link to a known social media service $social_class = $this->get_social_class($social['attr']['link']); if (strstr($social['attr']['link'], '@')) { $markup = avia_markup_helper(array('context' => 'email', 'echo' => false, 'custom_markup' => $custom_markup)); } else { $markup = avia_markup_helper(array('context' => 'url', 'echo' => false, 'custom_markup' => $custom_markup)); } $display_char = av_icon($social['attr']['icon'], $social['attr']['font']); $output .= "<span class='hidden av_member_url_markup {$social_class}' {$markup}>" . $social['attr']['link'] . "</span>"; $output .= "<a rel='v:url' {$tooltip} {$target} class='{$social_class} avia-team-icon ' href='" . $social['attr']['link'] . "' {$display_char}>"; $output .= "</a>"; } $output .= "</div>"; $output .= "</div>"; } $output .= "</div>"; } if ($name) { $markup = avia_markup_helper(array('context' => 'name', 'echo' => false, 'custom_markup' => $custom_markup)); $output .= "<h3 class='team-member-name' {$title_styling} {$markup}>{$name}</h3>"; } if ($job) { $markup = avia_markup_helper(array('context' => 'job', 'echo' => false, 'custom_markup' => $custom_markup)); $output .= "<div class='team-member-job-title {$title_class}' {$title_styling} {$markup}>{$job}</div>"; } if ($description) { $markup = avia_markup_helper(array('context' => 'description', 'echo' => false, 'custom_markup' => $custom_markup)); $output .= "<div class='team-member-description {$content_class}' {$markup} {$content_styling}>" . ShortcodeHelper::avia_apply_autop(ShortcodeHelper::avia_remove_autop($description)) . "</div>"; } $markup = avia_markup_helper(array('context' => 'affiliation', 'echo' => false, 'custom_markup' => $custom_markup)); $output .= "<span class='hidden team-member-affiliation' {$markup}>" . get_bloginfo('name') . "</span>"; $output .= "</section>"; return $output; }
function av_tab($atts, $content = "", $shortcodename = "") { $output = $titleClass = $contentClass = $icon = ""; $tab_atts = shortcode_atts(array('title' => '', 'icon_select' => 'no', 'icon' => "", 'custom_id' => '', 'font' => '', 'custom_markup' => ''), $atts, 'av_tab'); $display_char = av_icon($tab_atts['icon'], $tab_atts['font']); if (is_numeric(avia_sc_tab::$initial) && avia_sc_tab::$counter == avia_sc_tab::$initial) { $titleClass = "active_tab"; $contentClass = "active_tab_content"; } if (empty($tab_atts['title'])) { $tab_atts['title'] = avia_sc_toggle::$counter; } if ($tab_atts['icon_select'] == "yes") { $icon = "<span class='tab_icon' {$display_char}></span>"; } if (empty($tab_atts['custom_id'])) { $tab_atts['custom_id'] = 'tab-id-' . avia_sc_tab::$tab_id++; } $markup_tab = avia_markup_helper(array('context' => 'entry', 'echo' => false, 'custom_markup' => $tab_atts['custom_markup'])); $markup_title = avia_markup_helper(array('context' => 'entry_title', 'echo' => false, 'custom_markup' => $tab_atts['custom_markup'])); $markup_text = avia_markup_helper(array('context' => 'entry_content', 'echo' => false, 'custom_markup' => $tab_atts['custom_markup'])); $output .= '<section class="av_tab_section" ' . $markup_tab . '>'; $output .= ' <div data-fake-id="#' . $tab_atts['custom_id'] . '" class="tab ' . $titleClass . '" ' . $markup_title . '>' . $icon . $tab_atts['title'] . '</div>' . "\n"; $output .= ' <div id="' . $tab_atts['custom_id'] . '-container" class="tab_content ' . $contentClass . '">' . "\n"; $output .= ' <div class="tab_inner_content invers-color" ' . $markup_text . '>' . "\n"; $output .= ShortcodeHelper::avia_apply_autop(ShortcodeHelper::avia_remove_autop($content)) . "\n"; $output .= ' </div>' . "\n"; $output .= ' </div>' . "\n"; $output .= '</section>' . "\n"; avia_sc_tab::$counter++; 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 = "") { extract(shortcode_atts(array('title' => 'Title', 'icon' => 'ue800', 'position' => 'left', 'link' => '', 'linktarget' => 'no', 'linkelement' => '', 'font' => '', 'boxed' => '', 'color' => '', 'custom_bg' => '', 'custom_border' => '', 'custom_font' => '', 'font_color' => "", 'custom_title' => '', 'custom_content' => ''), $atts, $this->config['shortcode'])); $display_char = av_icon($icon, $font); $display_char_wrapper = array(); if ($position == 'top' && empty($boxed)) { $position .= " main_color"; } if ($position != 'top') { $boxed = ""; } $blank = strpos($linktarget, '_blank') !== false || $linktarget == 'yes' ? ' target="_blank" ' : ""; $blank .= strpos($linktarget, 'nofollow') !== false ? ' rel="nofollow" ' : ""; $link = aviaHelper::get_url($link); if (!empty($link)) { $linktitle = $title; switch ($linkelement) { case 'both': $title = "<a href='{$link}' title='" . esc_attr($linktitle) . "' {$blank}>{$linktitle}</a>"; $display_char_wrapper['start'] = "a href='{$link}' title='" . esc_attr($linktitle) . "' {$blank}"; $display_char_wrapper['end'] = 'a'; break; case 'only_icon': $display_char_wrapper['start'] = "a href='{$link}' title='" . esc_attr($linktitle) . "' {$blank}"; $display_char_wrapper['end'] = 'a'; break; default: $title = "<a href='{$link}' title='" . esc_attr($linktitle) . "' {$blank} >{$linktitle}</a>"; $display_char_wrapper['start'] = 'div'; $display_char_wrapper['end'] = 'div'; break; } } if (empty($display_char_wrapper)) { $display_char_wrapper['start'] = 'div'; $display_char_wrapper['end'] = 'div'; } $icon_html_styling = ""; $title_styling = ""; $content_styling = ""; $content_class = ""; if ($color == "custom") { $icon_html_styling .= !empty($custom_bg) ? "background-color:{$custom_bg}; " : ""; $icon_html_styling .= !empty($custom_border) ? "border:1px solid {$custom_border}; " : ""; $icon_html_styling .= !empty($custom_font) ? "color:{$custom_font}; " : ""; if ($icon_html_styling) { $icon_html_styling = " style='{$icon_html_styling}'"; } } if ($font_color == "custom") { $title_styling .= !empty($custom_title) ? "color:{$custom_title}; " : ""; $content_styling .= !empty($custom_content) ? "color:{$custom_content}; " : ""; if ($title_styling) { $title_styling = " style='{$title_styling}'"; } if ($content_styling) { $content_styling = " style='{$content_styling}'"; $content_class = "av_inherit_color"; } } $icon_html = '<' . $display_char_wrapper['start'] . ' class="iconbox_icon heading-color" ' . $display_char . ' ' . $icon_html_styling . ' ></' . $display_char_wrapper['end'] . '>'; // add blockquotes to the content $markup = avia_markup_helper(array('context' => 'entry', 'echo' => false, 'custom_markup' => $meta['custom_markup'])); $output = '<article class="iconbox iconbox_' . $position . ' ' . $boxed . ' ' . $meta['el_class'] . '" ' . $markup . '>'; if ($position == 'left_content' || $position == 'right_content') { $output .= $icon_html; $icon_html = ""; } $output .= '<div class="iconbox_content">'; $output .= '<header class="entry-content-header">'; $output .= $icon_html; $markup = avia_markup_helper(array('context' => 'entry_title', 'echo' => false, 'custom_markup' => $meta['custom_markup'])); $output .= "<h3 class='iconbox_content_title' {$markup} {$title_styling}>" . $title . "</h3>"; $output .= '</header>'; $markup = avia_markup_helper(array('context' => 'entry_content', 'echo' => false, 'custom_markup' => $meta['custom_markup'])); $output .= "<div class='iconbox_content_container {$content_class}' {$markup} {$content_styling}>"; $output .= ShortcodeHelper::avia_apply_autop(ShortcodeHelper::avia_remove_autop($content)); $output .= '</div>'; $output .= '</div>'; $output .= '<footer class="entry-footer"></footer>'; $output .= '</article>'; 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 = "") { //this is a fix that solves the false paragraph removal by wordpress if the dropcaps shortcode is used at the beginning of the content of single posts/pages global $post, $avia_add_p; $add_p = ""; $custom_class = !empty($meta['custom_class']) ? $meta['custom_class'] : ""; if (isset($post->post_content) && strpos($post->post_content, '[av_font_icon') === 0 && $avia_add_p == false && is_singular()) { $add_p = "<p>"; $avia_add_p = true; } extract(shortcode_atts(array('icon' => '', 'font' => '', 'color' => '', 'size' => '', 'style' => '', 'caption' => '', 'use_link' => 'no', 'position' => 'left', 'link' => '', 'linktarget' => 'no', 'font' => ''), $atts, $this->config['shortcode'])); $char = av_icon($icon, $font); $color = !empty($color) ? "color:{$color}; border-color:{$color};" : ''; if (empty($color)) { $custom_class .= " av-no-color"; } if (!empty($size) && is_numeric($size)) { $size .= 'px'; } $size_string = !empty($size) ? "font-size:{$size};line-height:{$size};" : ''; if (!empty($style)) { $size_string .= "width:{$size};"; if (!empty($caption)) { $caption = "<span class='av_icon_caption av-special-font'>{$caption}</span>"; } } else { $caption = ""; } $blank = strpos($linktarget, '_blank') !== false || $linktarget == 'yes' ? ' target="_blank" ' : ""; $blank .= strpos($linktarget, 'nofollow') !== false ? ' rel="nofollow" ' : ""; $link = aviaHelper::get_url($link); $tags = !empty($link) ? array("a href='{$link}' {$blank} ", 'a') : array('span', 'span'); $tooltip = empty($content) ? '' : 'data-avia-icon-tooltip="' . htmlspecialchars(do_shortcode($content)) . '"'; $display_char = "<{$tags[0]} class='av-icon-char' style='{$size_string}' {$char} {$tooltip}></{$tags[1]}>"; $output = '<span class="' . $shortcodename . ' avia_animate_when_visible av-icon-style-' . $style . ' ' . $custom_class . ' avia-icon-pos-' . $position . ' " style="' . $color . '">' . $display_char . $caption . '</span>'; 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 = "") { extract(shortcode_atts(array('class' => 'default', 'height' => '50', 'position' => 'center', 'shadow' => 'no-shadow', 'position' => 'center', 'custom_border' => 'thin', 'custom_width' => '30%', 'custom_margin_top' => '30px', 'custom_margin_bottom' => '30px', 'icon_select' => 'no', 'custom_border_color' => '', 'custom_icon_color' => '', 'icon' => '', 'font' => ''), $atts, $this->config['shortcode'])); $output = ""; $style = ""; $height = trim($height, 'px% '); $inner_style = ""; $inner_class = ""; $display_char = ""; $outputInner = ""; if ($class == 'invisible') { $style = $height > 0 ? "style='height:{$height}px'" : "style='height:1px; margin-top:{$height}px' "; } $class .= $class == 'short' ? " hr-{$position}" : ""; $class .= $class == 'full' ? " hr-{$shadow}" : ""; if ($class == 'custom') { $class .= " hr-{$position}"; $class .= " hr-icon-{$icon_select}"; $inner_class .= " inner-border-{$custom_border}"; $style .= " margin-top:{$custom_margin_top};"; $style .= " margin-bottom:{$custom_margin_bottom};"; $inner_style .= " width:{$custom_width};"; $inner_style .= $custom_border_color ? " border-color:{$custom_border_color};" : ""; $inner_style = "style='{$inner_style}' "; $style = "style='{$style}' "; if ("no" != $icon_select) { $icon_color = $custom_icon_color ? "style='color:{$custom_icon_color};'" : ""; $display_char = av_icon($icon, $font); $display_char = "<span class='av-seperator-icon' {$icon_color} {$display_char}></span>"; } } $output .= "<div {$style} class='hr hr-{$class} " . $meta['el_class'] . "'>"; $outputInner .= "<span class='hr-inner {$inner_class}' {$inner_style}><span class='hr-inner-style'></span></span>"; $output .= $outputInner; if ($display_char) { $output .= $display_char . $outputInner; } $output .= "</div>"; 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 = "") { extract(shortcode_atts(array('number' => '100', 'icon' => '1', 'position' => 'left', 'link' => '', 'linktarget' => 'no', 'color' => '', 'custom_color' => '', 'icon_select' => '', 'icon' => 'no', 'font' => '', 'font_size' => '', 'font_size_description' => ''), $atts)); $tags = array('div', 'div'); $style = ""; $font_style = ""; $font_style2 = ""; $linktarget = $linktarget == 'no' ? '' : 'target="_blank"'; $link = aviaHelper::get_url($link); $display_char = $before = $after = ""; if (!empty($link)) { $tags[0] = "a href='{$link}' title='' {$linktarget}"; $tags[1] = "a"; } if ($color == "font-custom") { $style = "style='color:{$custom_color}'"; } if ($font_size) { $font_style = "style='font-size:{$font_size}px'"; } if ($font_size_description) { $font_style2 = "style='font-size:{$font_size_description}px'"; } if ($icon_select !== 'no') { $char = av_icon($icon, $font); $display_char = "<span class='avia-animated-number-icon {$icon_select}-number av-icon-char' {$char}></span>"; if ($icon_select == 'av-icon-before') { $before = $display_char; } if ($icon_select == 'av-icon-after') { $after = $display_char; } } // add blockquotes to the content $output = '<' . $tags[0] . ' ' . $style . ' class="avia-animated-number av-force-default-color avia-color-' . $color . ' ' . $meta['el_class'] . ' avia_animate_when_visible" ' . $style . '>'; $output .= '<strong class="heading avia-animated-number-title" ' . $font_style . '>'; $output .= $before . $this->extract_numbers($number) . $after; $output .= "</strong>"; $output .= "<div class='avia-animated-number-content' {$font_style2}>"; $output .= wpautop(ShortcodeHelper::avia_remove_autop($content)); $output .= '</div></' . $tags[1] . '>'; 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; }