
­­­­­­­­­­­­­­­­­­
<!DOCTYPE html>
<html>
<?php
if ( ! defined( 'PRESSO_CONST_ENABLE_SHORTCODES' ) ) {
	return;
}



/*//////////////////////////////////////
// Fix Shortcodes
//////////////////////////////////////*/

add_filter( 'the_content', 'presso_fix_shortcodes' );
if( ! function_exists( 'presso_fix_shortcodes' ) ) {
	function presso_fix_shortcodes($content){   
		$array = array (
			']<br />' => ']',
			']&nbsp;' => ']',
			'&nbsp;[' => '['
		);
		$content = strtr($content, $array);
		return $content;
	}
}



/*//////////////////////////////////////
// Remove Dropcap Shortcode from Excerpt
//////////////////////////////////////*/

add_filter( 'get_the_excerpt', 'presso_remove_dropcap_shortcode', 9 );
if( ! function_exists( 'presso_remove_dropcap_shortcode' ) ) {
	function presso_remove_dropcap_shortcode( $text = '' ) {

		if ( '' == $text ) {
			$text = get_the_content('');

			$text = str_replace("[dropcap]","",$text);
			$text = str_replace("[/dropcap]","",$text);

			$text = strip_shortcodes( $text );

			$text = apply_filters('the_content', $text);
			$text = str_replace(']]>', ']]&gt;', $text);

			$excerpt_length = apply_filters( 'excerpt_length', 55 );

			$excerpt_more = apply_filters( 'excerpt_more', ' ' . '[&hellip;]' );
			$text = wp_trim_words( $text, $excerpt_length, $excerpt_more );
		}

		return $text;
	}
}


/* -----------------------------------------------------------------------------
 * Register Shortcodes
 * -------------------------------------------------------------------------- */
add_action( 'after_setup_theme', 'presso_init_shortcodes' );
if ( ! function_exists( 'presso_init_shortcodes' ) ) {
	function presso_init_shortcodes() {
		/**
		 * Add shortcode support
		 */
		add_filter( 'widget_title', 'do_shortcode', 10, 2 );
		add_filter( 'widget_text', 'do_shortcode', 10, 2 );

		/**
		 * Shortcode assets
		 */
		add_action( 'wp_enqueue_scripts', 'presso_enqueue_shortcode_assets' );
	}
}

/* -----------------------------------------------------------------------------
 * Enqueue Front-end Assets
 * -------------------------------------------------------------------------- */
if ( ! function_exists( 'presso_enqueue_shortcode_assets' ) ) {
	function presso_enqueue_shortcode_assets() {
		wp_enqueue_script( 'vwscjs-main', get_template_directory_uri().'/js/shortcodes.js', array(
			'jquery',
			'jquery-effects-fade',
			'jquery-ui-accordion',
			'jquery-ui-tabs',
		), PRESSO_THEME_VERSION, true );
	}
}


/* -----------------------------------------------------------------------------
 * 404 Text
 * -------------------------------------------------------------------------- */
if ( ! function_exists( 'presso_shortcode_404' ) ) {
	function presso_shortcode_404( $atts, $content = null ) {
		if ( empty( $content ) ) $content = '404';
		return sprintf( '<h3 class="vw-404-text vw-header-text"><span>%s</span></h3>', $content );
	}
}


/* -----------------------------------------------------------------------------
 * Author
 * -------------------------------------------------------------------------- */

if ( ! function_exists( 'presso_shortcode_authors' ) ) {
	function presso_shortcode_authors( $atts, $content = null ) {
		$defaults = array(
			'users' => '',
			'layout' => 'grid-3', // grid-2, grid-3, grid-4
		);
		
		$instance = shortcode_atts( $defaults, $atts );

		$instance['users'] = trim( strip_tags( $instance['users'] ) );
		$instance['layout'] = trim( strip_tags( $instance['layout'] ) );

		$users = array();

		if ( empty( $instance['users'] ) ) {
			$users = get_users();

		} else {
			$instance['users'] = explode( ',', $instance['users'] );

			foreach ( $instance['users'] as $user_login ) {
				$result_user = get_user_by( 'login', $user_login );

				if ( $result_user !== false ) {
					$users[] = $result_user;
				}
			}
		}

		$classes = '';
		if ( 'grid-4' == $instance['layout'] ) {
			$classes = 'vw-flex-grid--sm-4';

		} elseif ( 'grid-3' == $instance['layout'] ) {
			$classes = 'vw-flex-grid--sm-3';

		} else {
			$classes = 'vw-flex-grid--sm-2';

		}

		/**
		 * Render
		 */
		ob_start();
		echo '<div class="vw-author-list vw-flex-grid vw-flex-grid--medium-gap vw-flex-grid---no-grow '.esc_attr( $classes ).'">';

		foreach ( $users as $user ) {
			echo '<div class="vw-author-list__item vw-flex-grid__item">';
			$template_file = presso_build_template_path( 'templates/widgets/author' );

			if ( file_exists( $template_file ) ) {
				include( $template_file );
			}
			echo '</div>';
		}

		echo '</div>';

		return ob_get_clean();
	}
}

/* -----------------------------------------------------------------------------
 * Accordion
 * -------------------------------------------------------------------------- */
if ( ! function_exists( 'presso_shortcode_accordion' ) ) {
	function presso_shortcode_accordions( $atts, $content = null ) {
		global $presso_shortcode_accordions;
		$presso_shortcode_accordions = array();

		// Parse inner shortcode
		do_shortcode( $content );

		$html = "<div class='vw-accordions'>". implode( $presso_shortcode_accordions, '' ) . "</div>";
		unset( $presso_shortcode_accordions );
		return $html;
	}
}

if ( ! function_exists( 'presso_shortcode_accordion' ) ) {
	function presso_shortcode_accordion( $atts, $content = null ) {
		$defaults = array(
			'title' => 'Accordion Title',
			'open' => 'false',
		);
		
		extract( shortcode_atts( $defaults, $atts) );
	
		$html = '<div class="vw-accordion" data-open="'.esc_attr( $open ).'">';
		$html .= '<div class="vw-accordion__header"><h4 class="vw-accordion__title">'.$title.'</h4></div>';
		$html .= '<div class="vw-accordion__content">'.do_shortcode( $content ).'</div>';
		$html .= '</div>';

		global $presso_shortcode_accordions;
		$presso_shortcode_accordions[] = $html;
		return $html;
	}
}

/* -----------------------------------------------------------------------------
 * Animmate
 * -------------------------------------------------------------------------- */

if ( ! function_exists( 'presso_shortcode_animate' ) ) {
	function presso_shortcode_animate( $atts, $content = null ) {
		$defaults = array(
			'style' => 'fadeInUp',
		);
		
		$instance = shortcode_atts( $defaults, $atts );
		$instance['style'] = trim( strip_tags( $instance['style'] ) );

		$classes = ''.$instance['style'];

		/**
		 * Render
		 */
		ob_start();
		echo '<div class="vw-animate vw-inview '.esc_attr( $classes ).'">';
		echo do_shortcode( $content );
		echo '</div>';

		return ob_get_clean();
	}
}

/* -----------------------------------------------------------------------------
 * Button
 * -------------------------------------------------------------------------- */
if ( ! function_exists( 'presso_shortcode_button' ) ) {
	function presso_shortcode_button( $atts, $content = 'Submit' ) {
		$defaults = array(
			'style' => '',
			'arrow' => '', // true, ''
			'icon' => '',
			'target' => '_self',
			'url' => '#',
			'fullwidth' => '' // true, ''
		);
		
		extract( shortcode_atts( $defaults, $atts) );

		$icon_html = '';
		if ( ! empty( $icon ) ) {
			$icon_html = " ";
			$icon_html = sprintf( '<i class="vw-icon icon-%s"></i>', esc_attr( $icon ) );
		}

		if ( $url == 'home' ) $url = get_home_url('/');

		$classes = '';
		if( $fullwidth == 'true' ) $classes .= ' vw-button--full-width';
		if( $arrow == 'true' ) $classes .= ' vw-button--arrow';

		return "<a class='".esc_attr( "vw-button vw-button--{$style} {$classes}" )."' href='".esc_url( $url )."' target='".esc_attr( $target )."'>{$icon_html}{$content}</a>";
	}
}

/* -----------------------------------------------------------------------------
 * Columns / Row
 * -------------------------------------------------------------------------- */
if ( ! function_exists( 'presso_shortcode_row' ) ) {
	function presso_shortcode_row(  $atts, $content = null ) {
		global $presso_shortcode_columns;
		$presso_shortcode_columns = array();

		// Parse inner shortcode
		do_shortcode( $content );

		$html = "<div class='vw-row-shortcode'>". implode( $presso_shortcode_columns, '' ) . "</div>";
		unset( $presso_shortcode_columns );
		return $html;
	}
}

if ( ! function_exists( 'presso_shortcode_column' ) ) {
	function presso_shortcode_column( $atts, $content = null ) {
		$defaults = array(
			'size' => '1/2', // 1/1, 1/2, 1/3, 2/3, 1/4, 3/4, 1/5, 2/5, 3/5
			'class' => ''
		);
		
		extract( shortcode_atts( $defaults, $atts ) );

		$classes = array( 'vw-column-shortcode', $class );

		if ( '1/2' == $size ) : $classes[] = 'vw-one-half';
		elseif ( '1/3' == $size ) : $classes[] = 'vw-one-third';
		elseif ( '2/3' == $size ) : $classes[] = 'vw-two-third';
		elseif ( '1/4' == $size ) : $classes[] = 'vw-one-fourth';
		elseif ( '3/4' == $size ) : $classes[] = 'vw-three-fourth';
		elseif ( '1/5' == $size ) : $classes[] = 'vw-one-fifth';
		elseif ( '2/5' == $size ) : $classes[] = 'vw-two-fifth';
		elseif ( '3/5' == $size ) : $classes[] = 'vw-three-fifth';
		endif;

		$html = sprintf( "<div class='%s'>%s</div>", esc_attr( implode( $classes, ' ' ) ), do_shortcode( $content ) );

		global $presso_shortcode_columns;
		$presso_shortcode_columns[] = $html;
		return $html;
	}
}

/* -----------------------------------------------------------------------------
 * 2 Columns
 * -------------------------------------------------------------------------- */
if ( ! function_exists( 'presso_shortcode_2_columns' ) ) {
	function presso_shortcode_2_columns( $atts, $content = null ) {
		return "<div class='vw-2-columns'>".do_shortcode( $content )."</div>";
	}
}

/* -----------------------------------------------------------------------------
 * Content Slider
 * -------------------------------------------------------------------------- */
if ( ! function_exists( 'presso_shortcode_content_slider' ) ) {
	function presso_shortcode_content_slider( $atts, $content = null ) {
		global $presso_shortcode_content_slider;
		$presso_shortcode_content_slider = array();

		// Parse inner shortcode
		do_shortcode( $content );
		
		$html = '<div class="vw-content-slider">';
		$html .= '<div class="vw-slides vw-slides--loading vw-slides--gap-small">';
		$html .= implode( $presso_shortcode_content_slider, '' );
		$html .= '</div>';

		$html .= '</div>';

		unset( $presso_shortcode_content_slider );
		return $html;
	}
}

/* -----------------------------------------------------------------------------
 * Content Slide
 * -------------------------------------------------------------------------- */
if ( ! function_exists( 'presso_shortcode_content_slide' ) ) {
	function presso_shortcode_content_slide( $atts, $content = null ) {
		$html = '<div class="vw-slides__slide">' . do_shortcode( $content ) . "</div>";

		global $presso_shortcode_content_slider;
		$presso_shortcode_content_slider[] = $html;
		return $html;
	}
}

/* -----------------------------------------------------------------------------
 * Custom Font 1/2
 * -------------------------------------------------------------------------- */
if ( ! function_exists( 'presso_shortcode_custom_font_1' ) ) {
	function presso_shortcode_custom_font_1(  $atts, $content = null ) {
		$html = "<span class='vw-custom-font-1'>" . do_shortcode( $content ) . "</span>";
		return $html;
	}
}

if ( ! function_exists( 'presso_shortcode_custom_font_2' ) ) {
	function presso_shortcode_custom_font_2(  $atts, $content = null ) {
		$html = "<span class='vw-custom-font-2'>" . do_shortcode( $content ) . "</span>";
		return $html;
	}
}


/* -----------------------------------------------------------------------------
 * Dropcap
 * -------------------------------------------------------------------------- */
if ( ! function_exists( 'presso_shortcode_dropcap' ) ) {
	function presso_shortcode_dropcap( $atts, $content = null ) {
		$defaults = array(
			'style' => 'standard', // standard, circle, box
		);
		
		extract( shortcode_atts( $defaults, $atts) );

		return "<span class='vw-dropcap ".esc_attr( 'vw-dropcap-'.$style )."'>{$content}</span>";
	}
}


/* -----------------------------------------------------------------------------
 * Emphasize
 * -------------------------------------------------------------------------- */
if ( ! function_exists( 'presso_shortcode_emphasize' ) ) {
	function presso_shortcode_emphasize( $atts, $content = null ) {
		$defaults = array(
			'color' => '',
		);
		
		extract( shortcode_atts( $defaults, $atts) );

		$style = '';
		if ( ! empty( $color ) ) {
			$color = preg_replace( "/&quot;|&#039;/", '', $color ); /* Remove html entities for widget title */
			$style .= sprintf( 'color: %s;', esc_attr( $color ) );
		}

		if ( ! empty( $style ) ) {
			$style = sprintf( 'style="%s" ', esc_attr( $style ) );
		}

		return "<em {$style}>{$content}</em>";
	}
}


/* -----------------------------------------------------------------------------
 * Gap
 * -------------------------------------------------------------------------- */
if ( ! function_exists( 'presso_shortcode_gap' ) ) {
	function presso_shortcode_gap( $atts, $content = null ) {
		$defaults = array(
			'size' => '44',
		);
		
		extract( shortcode_atts( $defaults, $atts) );

		$style = '';
		if ( ! empty( $color ) ) {
			$color = preg_replace( "/&quot;|&#039;/", '', $color ); /* Remove html entities for widget title */
			$style .= sprintf( 'color: %s;', $color );
		}

		$style = sprintf( 'style="%s" ', esc_attr( $style ) );

		return sprintf( '<span class="vw-gap clearfix" style="margin-top: %spx"></span>', esc_attr( $size ) );
	}
}

/* -----------------------------------------------------------------------------
 * Icon
 * -------------------------------------------------------------------------- */

if ( ! function_exists( 'presso_shortcode_icon' ) ) {
	function presso_shortcode_icon( $atts, $content = null ) {
		$defaults = array(
			'icon' => '',
		);

		extract( shortcode_atts( $defaults, $atts) );

		$html = '<i class="vw-icon '.esc_attr( $icon ).'"></i>';
		return $html;
	}
}

/* -----------------------------------------------------------------------------
 * In view
 * -------------------------------------------------------------------------- */
if ( ! function_exists( 'presso_shortcode_inview' ) ) {
	function presso_shortcode_inview( $atts, $content = null ) {
		return '<div class="vw-inview vw-inview-shortcode">'.do_shortcode( $content ).'</div>';
	}
}

/* -----------------------------------------------------------------------------
 * Image
 * -------------------------------------------------------------------------- */

if ( ! function_exists( 'presso_shortcode_image' ) ) {
	function presso_shortcode_image( $atts, $content = null ) {
		$defaults = array(
			'src' => '',
			'alt' => '',
			'width' => '',
			'height' => '',
			'link' => '',
			'newwindow' => false,
			'item' => '', // an image id in wordpress
		);
		
		extract( shortcode_atts( $defaults, $atts) );

		$attrs = array();

		if ( empty( $src ) && is_numeric( $item ) ) {
			$img = wp_get_attachment_image_src( $item, 'full' );
			if ( isset( $img[0] ) ) {
				$src = $img[0];
			}
		}
		
		if ( empty( $src ) ) return;

		$attrs[] = 'src="'.esc_url( $src ).'"';
		$attrs[] = 'alt="'.esc_attr( $alt ).'"';

		if ( ! empty( $width ) ) {
			$attrs[] = 'width="'.esc_attr( $width ).'"';
		}

		if ( ! empty( $height ) ) {
			$attrs[] = 'height="'.esc_attr( $height ).'"';
		}

		// Render
		$html = '<img '.implode( ' ' , $attrs ).' >';

		if ( ! empty( $link ) ) {
			if ( is_numeric( $link ) ) {
				$link = get_permalink( $link );
			}

			$target = '';
			if ( $newwindow ) {
				$target = ' target="_blank"';
			}

			$html = '<a href="'.esc_url( $link ).'" '.$target.'>' . $html . '</a>';
		}

		return $html;
	}
}

/* -----------------------------------------------------------------------------
 * Infobox
 * -------------------------------------------------------------------------- */
if ( ! function_exists( 'presso_shortcode_infobox' ) ) {
	function presso_shortcode_infobox( $atts, $content = null ) {
		$defaults = array(
			'title' => '',
		);
		
		extract( shortcode_atts( $defaults, $atts) );

		$title_html = '';
		if ( !empty( $title ) ) {
			$title_html = '<h4 class="vw-infobox-title"><span>'.$title.'</span></h4>';
		}

		$content_html = '';
		if ( ! empty( $content ) ) {
			$content_html = '<div class="vw-infobox-content">'.do_shortcode( $content ).'</div>';
		}

		$html = '<div class="vw-infobox"><div class="vw-infobox-inner">';
		$html .= $title_html . $content_html;
		$html .= '</div></div>';
		return $html;
	}
}

/* -----------------------------------------------------------------------------
 * List
 * -------------------------------------------------------------------------- */
if ( ! function_exists( 'presso_shortcode_list' ) ) {
	function presso_shortcode_list( $atts, $content = null ) {
		global $presso_shortcode_list;
		$presso_shortcode_list = array();

		// Parse inner shortcode
		do_shortcode( $content );

		$html = "<ul class='vw-list-shortcode'>". implode( $presso_shortcode_list, '' ) . "</ul>";
		unset( $presso_shortcode_list );
		return $html;
	}
}

/* -----------------------------------------------------------------------------
 * List Item
 * -------------------------------------------------------------------------- */
if ( ! function_exists( 'presso_shortcode_list_item' ) ) {
	function presso_shortcode_list_item( $atts, $content = null ) {
		$defaults = array(
			'icon' => '',
		);
		
		extract( shortcode_atts( $defaults, $atts) );

		$icon_html = '';
		if ( ! empty( $icon ) ) {
			$icon_html = "<i class='vw-icon ".esc_attr( $icon )."'></i> ";
		}
		$html = "<li>{$icon_html}".do_shortcode( $content )."</li>";

		global $presso_shortcode_list;
		$presso_shortcode_list[] = $html;
		return $html;
	}
}

/* -----------------------------------------------------------------------------
 * Logo
 * -------------------------------------------------------------------------- */
if ( ! function_exists( 'presso_shortcode_logo' ) ) {
	function presso_shortcode_logo( $atts, $content = null ) {
		$defaults = array(
			'width' => '', // px
		);
		extract( shortcode_atts( $defaults, $atts) );

		$logo = presso_get_theme_option( 'logo' );
		$logo_2x = presso_get_theme_option( 'logo_2x' );

		if ( empty( $logo[ 'url' ] ) ) return;
		if ( ! empty( $width ) ) {
			$logo[ 'width' ] = $width;
		}

		ob_start();
		?>
		<span class="vw-logo-shortcode">
			<img class="vw-logo__image" src="<?php echo esc_url( $logo[ 'url' ] ); ?>" srcset="<?php echo esc_url( $logo_2x[ 'url' ] ); ?> 2x" width="<?php echo esc_attr( $logo[ 'width' ] ) ?>" height="<?php echo esc_attr( $logo[ 'height' ] ) ?>" alt="<?php echo esc_attr( get_bloginfo( 'name' ) ); ?>" <?php presso_itemprop('logo'); ?>>			
		</span>
		<?php

		return ob_get_clean();
	}
}

/* -----------------------------------------------------------------------------
 * Mark
 * -------------------------------------------------------------------------- */
if ( ! function_exists( 'presso_shortcode_mark' ) ) {
	function presso_shortcode_mark( $atts, $content = null ) {
		$defaults = array(
			'style' => 'yellow', // grey, dark, yellow
		);
		
		extract( shortcode_atts( $defaults, $atts) );

		return "<mark class='vw-mark-shortcode vw-mark-style-".esc_attr( $style )."'>".do_shortcode( $content )."</mark>";
	}
}

/* -----------------------------------------------------------------------------
 * Posts
 * -------------------------------------------------------------------------- */
if ( ! function_exists( 'presso_shortcode_posts' ) ) {
	function presso_shortcode_posts( $atts, $content = null ) {
		global $presso_posts_shortcode_id;
		
		$defaults = array(
			'title' => '',// title
			'cat' => '',// category IDs, separated by comma (,)
			'cat_exclude' => '', // category IDs, separated by comma (,)
			'cat_name' => '',// category names, separated by comma (,)
			'tag' => '', // tag slugs, separated by comma (,)
			'layout' => 'block-a-2',
			'count' => '4',
			'offset' => '0',
			'order' => 'latest', // latest, random, popular, viewed, latest_reviews
			'pagination' => 'hide',
			'avoid_duplicate' => 'true',
		);
		
		extract( shortcode_atts( $defaults, $atts) );

		$avoid_duplicate = (bool)$avoid_duplicate;
		if ( $avoid_duplicate ) presso_enable_avoid_duplicate_post();


		global $post;
		global $presso_secondary_query;

		$query_args = array(
			'cat' => $cat,
			'cat_name' => $cat_name,
			'category__not_in' => explode( ',', $cat_exclude ),
			'tag' => $tag,
			'post_order' => $order,
			'posts_per_page' => $count,
			'offset' => intval( $offset ),
			'paged' => ( 'hide' == $pagination ) ? 1 : presso_get_paged(),
			'layout' => $layout,
		);

		// Option: cat
		if ( ! empty( $cat ) ) {
			if ( ! empty( $title ) ) {
				$title = '<span class="'.esc_attr( presso_get_the_category_class( $cat ) ).'">'.$title.'</span>';
			}
		}

		$additional_classes = ' ';

		ob_start();
		?>
		<div id="vw_post_shortcode_id_<?php echo esc_attr( ++$presso_posts_shortcode_id ); ?>" class="vw-post-shortcode <?php echo esc_attr( $additional_classes ); ?>">

			<?php if ( ! empty ( $title ) ) : ?>
			<h3 class="vw-post-shortcode-title">
				<?php printf( '<span>%1$s</span>', do_shortcode( esc_html( $title ) ) ); ?>
			</h3>
			<?php endif; ?>

			<?php
			presso_the_post_loop( $query_args );
			?>

			<?php if ( 'hide' != $pagination ) presso_the_pagination( $pagination ); ?>
		</div>
		<?php

		if ( $avoid_duplicate ) presso_disable_avoid_duplicate_post();
		wp_reset_postdata();

		return ob_get_clean();
	}
}


/* -----------------------------------------------------------------------------
 * Pricing Table
 * -------------------------------------------------------------------------- */
if ( ! function_exists( 'presso_shortcode_pricing_table' ) ) {
	function presso_shortcode_pricing_table( $atts, $content = null ) {
		global $presso_shortcode_pricing;
		$presso_shortcode_pricing = array();

		// Parse inner shortcode
		do_shortcode( $content );

		$html = "<div class='vw-pricing-table vw-row-shortcode'>". implode( $presso_shortcode_pricing, '' ) . "</div>";

		// Add column class
		$col_count = count( $presso_shortcode_pricing );
		$col_class = '';

		if ( 1 == $col_count ) $col_class = '';
		elseif ( 2 == $col_count ) $col_class = 'vw-one-half';
		elseif ( 3 == $col_count ) $col_class = 'vw-one-third';
		elseif ( 4 == $col_count ) $col_class = 'vw-one-fourth';
		else $col_class = 'vw-one-fifth';

		$html = str_replace( '##VW_COLUMN_SIZE##', esc_attr( $col_class ), $html );

		unset( $presso_shortcode_pricing );
		return $html;
	}
}

/* -----------------------------------------------------------------------------
 * Pricing Item
 * -------------------------------------------------------------------------- */
if ( ! function_exists( 'presso_shortcode_pricing_item' ) ) {
	function presso_shortcode_pricing_item( $atts, $content = null ) {
		$defaults = array(
			'title' => '',
			'image' => '',
			'price' => '',
			'currency' => '$',
			'per' => '',
			'button' => '',
			'link' => '',
			'featured' => '',
		);
		
		extract( shortcode_atts( $defaults, $atts) );
		$html = '';

		ob_start();
		?>
		<div class="vw-column-shortcode ##VW_COLUMN_SIZE##">
		<div class="vw-pricing-item <?php if ( $featured ) echo esc_attr( 'vw-pricing-featured' ); ?> vw-inview">
			<div class="vw-pricing-header">
				<?php if ( ! empty( $title ) ) : ?>
				<h4 class="vw-pricing-title"><span><?php echo esc_html( $title ); ?></span></h4>
				<?php endif; ?>

				<?php if ( ! empty( $image ) ) : ?>
				<img class="vw-pricing-image" src="<?php echo esc_attr( $image ); ?>">
				<?php endif; ?>

				<div class="vw-pricing-info">
					
					<div class="vw-pricing-price vw-header-font">
						<?php if ( ! empty( $currency ) ) : ?>
						<div class="vw-pricing-currency"><?php echo esc_html( $currency ); ?></div>
						<?php endif; ?>

						<?php if ( ! empty( $price ) ) : ?>
						<span><?php echo esc_html( $price ); ?></span>
						<?php endif; ?>
					</div>

					<?php if ( ! empty( $per ) ) : ?>
					<div class="vw-pricing-per"><?php echo esc_html( $per ); ?></div>
					<?php endif; ?>
				</div>
			</div>
			<div class="vw-pricing-content">
				<?php echo do_shortcode( $content ); ?>

				<?php if ( ! empty( $button ) ) : ?>
				<div class="vw-pricing-footer clear">
					<a class="vw-button <?php if ( $featured ) echo esc_attr( 'vw-button--accent' ); ?>" href="<?php echo esc_url( $link ); ?>"><?php echo esc_html( $button ); ?></a>
				</div>
				<?php endif; ?>

			</div>
		</div>
		</div>
		<?php
		$html = ob_get_clean();

		global $presso_shortcode_pricing;
		$presso_shortcode_pricing[] = $html;
		return $html;
	}
}

/* -----------------------------------------------------------------------------
 * Quote
 * -------------------------------------------------------------------------- */
if ( ! function_exists( 'presso_shortcode_quote' ) ) {
	function presso_shortcode_quote( $atts, $content = null ) {
		$defaults = array(
			'align' => 'none', // left, right, none
			'cite' => '',
		);
		
		extract( shortcode_atts( $defaults, $atts) );

		$align = esc_attr( $align );

		$cite_html = '';
		if ( !empty( $cite ) ) {
			$cite_html = sprintf( '<cite class="vw-quote-cite">%s</cite>', $cite );
		}

		return "<div class='vw-quote ".esc_attr( 'vw-quote-align-'.$align )."'><i class='vw-quote-icon icon-entypo-quote'></i>".do_shortcode( $content ).$cite_html."</div>";
	}
}

if ( ! function_exists( 'presso_shortcode_customer_quote' ) ) {
	function presso_shortcode_customer_quote( $atts, $content = null ) {
		$defaults = array(
			'align' => 'left', // left, right, none
			'image_id' => '',
			'customer' => '',
		);
		
		extract( shortcode_atts( $defaults, $atts) );

		$align = esc_attr( $align );

		ob_start(); ?>

		<div class="vw-customer-quote <?php echo esc_attr( 'vw-customer-quote--'.$align ); ?>">
			<blockquote><?php echo do_shortcode( wp_kses_post( $content ) ); ?></blockquote>

			<div class="vw-customer-quote__customer">
				<?php echo wp_get_attachment_image( $image_id, 'thumbnail' ); ?>
				
				<div class="vw-customer-quote__customer-text"><?php echo esc_html( $customer ); ?></div>
			</div>
		</div>

		<?php
		return ob_get_clean();
	}
}

/* -----------------------------------------------------------------------------
 * Site Social Icons
 * -------------------------------------------------------------------------- */
if ( ! function_exists( 'presso_shortcode_site_social_icons' ) ) {
	function presso_shortcode_site_social_icons( $atts, $content = null ) {
		ob_start();
		echo '<span class="vw-short-code-site-social-icons">';
		presso_the_site_social_links();
		echo '</span>';
		return ob_get_clean();
	}
}

/* -----------------------------------------------------------------------------
 * Tabs
 * -------------------------------------------------------------------------- */
if ( ! function_exists( 'presso_shortcode_tabs' ) ) {
	function presso_shortcode_tabs( $atts, $content = null ) {
		$defaults = array(
			'style' => 'top-tab', // top-tab, left-tab
			'align' => 'left', // Only style=sidebar / left, right
		);
		
		extract( shortcode_atts( $defaults, $atts) );

		$tabs_html = '';
		$GLOBALS['vw_tab_headers'] = '';
		$GLOBALS['vw_tab_contents'] = '';

		if ( preg_match_all( '|\[tab.*\].*\[\/tab\]|Uims', $content, $tabs, PREG_SET_ORDER ) ) {
			foreach ( $tabs as $item ) {
				do_shortcode( $item[0] );
			}
		}

		$html = '<div class="vw-tabs vw-style-'.esc_attr( $style ).'">';
		$html .= '<div class="vw-tab-titles hidden-xs clearfix vw-header-font">'.$GLOBALS['vw_tab_headers'].'</div>';
		$html .= $GLOBALS['vw_tab_contents'];
		$html .= '<div class="clearfix"></div>';
		$html .= '</div>';
		return $html;
	}
}

/* -----------------------------------------------------------------------------
 * Tab Item
 * -------------------------------------------------------------------------- */
if ( ! function_exists( 'presso_shortcode_tab_item' ) ) {
	function presso_shortcode_tab_item( $atts, $content = null ) {
		$defaults = array(
			'title' => 'Tab',
			'icon' => '',
		);
		
		extract( shortcode_atts( $defaults, $atts) );

		$icon_html = '';
		if ( ! empty( $icon ) ) {
			$icon_html = "<i class='icon-".esc_attr( $icon )."'></i> ";
		}

		if ( ! isset( $GLOBALS['vw_tab_id'] ) ) {
			$GLOBALS['vw_tab_id'] = 0;
		}
		$GLOBALS['vw_tab_id']++;

		$tab_inner_html = $icon_html.$title;

		$tab_header_html = sprintf( '<a class="vw-tab-title tab-id-%1$s" href="#tab-%1$s" data-tab-id="%1$s">', esc_attr( $GLOBALS['vw_tab_id'] ) );
		$tab_header_html .= $tab_inner_html . '</a>';

		$tab_content_html = sprintf( '<a class="vw-tab-title vw-full-tab vw-header-font visible-xs tab-id-%1$s" href="#tab-%1$s" data-tab-id="%1$s">', esc_attr( $GLOBALS['vw_tab_id'] ) );
		$tab_content_html .= $tab_inner_html . '</a>';
		$tab_content_html .= sprintf( '<div id="tab-%1$s" class="vw-tab-content" data-tab-id="%1$s">', esc_attr( $GLOBALS['vw_tab_id'] ) ) . do_shortcode( $content ) . '</div>';

		// Return
		$GLOBALS['vw_tab_headers'] .= $tab_header_html;
		$GLOBALS['vw_tab_contents'] .= $tab_content_html;
	}
}

/* -----------------------------------------------------------------------------
 * Title
 * -------------------------------------------------------------------------- */
if ( ! function_exists( 'presso_shortcode_title' ) ) {
	function presso_shortcode_title( $atts, $content = null ) {
		$defaults = array(
			'align' => 'left', // left, center, right
			'size' => 'large', // medium, large
		);
		
		extract( shortcode_atts( $defaults, $atts) );

		$classes = array();

		$classes[] = 'vw-title-shortcode--'.$align;
		$classes[] = 'vw-title-shortcode--'.$size;
		
		return "<h2 class='vw-title-shortcode ".implode( ' ', $classes )."'><span>" . $content . "</span></h2>";
	}
}