/** * 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_grid_row::$count++; $atts = shortcode_atts(array('color' => 'main_color', 'border' => '', 'min_height' => '0', 'mobile' => 'av-flex-cells', 'id' => ''), $atts, $this->config['shortcode']); extract($atts); $output = ""; $params['class'] = "av-layout-grid-container {$color} {$mobile} {$border}" . $meta['el_class']; $params['open_structure'] = false; $params['id'] = !empty($id) ? $id : "av-layout-grid-" . avia_sc_grid_row::$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 (isset($meta['index']) && $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 (isset($meta['index']) && $meta['index'] != 0) { $params['class'] .= " submenu-not-first"; } avia_sc_cell::$attr = $atts; $output .= avia_new_section($params); $output .= ShortcodeHelper::avia_remove_autop($content, true); $output .= avia_section_after_element_content($meta, 'after_submenu', false); 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 = "") { $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 = "") { $atts = shortcode_atts(array('style' => '', 'menu' => '', 'position' => 'center', 'sticky' => '', 'color' => 'main_color'), $atts, $this->config['shortcode']); extract($atts); $output = ""; $sticky_div = ""; avia_sc_submenu::$count++; $params['class'] = "av-submenu-container {$color} " . $meta['el_class']; $params['open_structure'] = false; $params['id'] = "sub_menu" . avia_sc_submenu::$count; $params['custom_markup'] = $meta['custom_markup']; $params['style'] = "style='z-index:" . (avia_sc_submenu::$count + 300) . "'"; if ($sticky && $sticky != "disabled") { $params['class'] .= " av-sticky-submenu"; $params['before_new'] = "<div class='clear'></div>"; $sticky_div = "<div class='sticky_placeholder'></div>"; } //we dont need a closing structure if the element is the first one or if a previous fullwidth element was displayed before if (isset($meta['index']) && $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 (isset($meta['index']) && $meta['index'] != 0) { $params['class'] .= " submenu-not-first"; } $element = wp_nav_menu(array('menu' => wp_get_nav_menu_object($menu), 'menu_class' => "av-subnav-menu av-submenu-pos-{$position}", 'fallback_cb' => '', 'container' => false, 'echo' => false, 'walker' => new avia_responsive_mega_menu(array('megamenu' => 'disabled')))); // if(!ShortcodeHelper::is_top_level()) return $element; $output .= avia_new_section($params); $output .= "<div class='container'>" . $element . "</div>"; $output .= avia_section_after_element_content($meta, 'after_submenu', false, $sticky_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('style' => '', 'menu' => '', 'position' => 'center', 'sticky' => '', 'color' => 'main_color', 'mobile' => 'disabled', 'mobile_submenu' => '', 'which_menu' => ''), $atts, $this->config['shortcode']); extract($atts); $output = ""; $sticky_div = ""; avia_sc_submenu::$count++; avia_sc_submenu::$custom_items = 0; $params['class'] = "av-submenu-container {$color} " . $meta['el_class']; $params['open_structure'] = false; $params['id'] = "sub_menu" . avia_sc_submenu::$count; $params['custom_markup'] = $meta['custom_markup']; $params['style'] = "style='z-index:" . (avia_sc_submenu::$count + 300) . "'"; if ($sticky && $sticky != "disabled") { $params['class'] .= " av-sticky-submenu"; $params['before_new'] = "<div class='clear'></div>"; $sticky_div = "<div class='sticky_placeholder'></div>"; } //we dont need a closing structure if the element is the first one or if a previous fullwidth element was displayed before if (isset($meta['index']) && $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 (isset($meta['index']) && $meta['index'] != 0) { $params['class'] .= " submenu-not-first"; } if ($which_menu == "custom") { $element = ""; $custom_menu = ShortcodeHelper::avia_remove_autop($content, true); if (!empty($custom_menu)) { $element .= "<ul id='av-custom-submenu-" . avia_sc_submenu::$count . "' class='av-subnav-menu av-submenu-pos-{$position}'>"; $element .= $custom_menu; $element .= "</ul>"; } } else { $element = wp_nav_menu(array('menu' => wp_get_nav_menu_object($menu), 'menu_class' => "av-subnav-menu av-submenu-pos-{$position}", 'fallback_cb' => '', 'container' => false, 'echo' => false, 'walker' => new avia_responsive_mega_menu(array('megamenu' => 'disabled')))); } $submenu_hidden = ""; $mobile_button = $mobile == "active" ? "<a href='#' class='mobile_menu_toggle' " . av_icon_string('mobile_menu') . "><span class='av-current-placeholder'>" . __('Menu', 'avia_framework') . "</span></a>" : ""; if (!empty($mobile_button) && !empty($mobile_submenu) && $mobile_submenu != "disabled") { $submenu_hidden = "av-submenu-hidden"; } // if(!ShortcodeHelper::is_top_level()) return $element; $output .= avia_new_section($params); $output .= "<div class='container av-menu-mobile-{$mobile} {$submenu_hidden}'>{$mobile_button}" . $element . "</div>"; $output .= avia_section_after_element_content($meta, 'after_submenu', false, $sticky_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 = "") { 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; }