<?php
function features($atts)
{
    extract(shortcode_atts(array(
        'text'               	=> '',
        'content'               => '',
        'icon'               	=> '',
        'linktext'              => '',
        'link'               	=> '',
        'type'               	=> ''
    ), $atts));
    
    $result ='';
    if($type == 'Feature-Style1')
    {
        $result .= '
		<div class="infobox">
			<div class="text">
				<p><em>'.esc_attr($content).'</em></p>
				<a href="'.esc_url($link).'" class="btn">'.esc_attr($linktext).'</a>
			</div>
		</div>';
    }
    elseif($type == 'Feature-Style2')
    {
        $result .= '
		<div class="infobox">
			<div class="icon">
				<i class="icon-'.esc_attr($icon).'"></i>
			</div>
			<div class="text">
				<h3 class="heading">'.esc_attr($text).'</h3>
				<p>'.esc_html($content).'</p>
			</div>
		</div>';
    }
	elseif($type == 'Feature-Style3')
    {
        $result .= '
		<div class="infobox style-2">
			<div class="icon">
				<i class="icon-'.esc_attr($icon).'"></i>
			</div>
			<div class="text">
				<h3 class="heading">'.esc_attr($text).'</h3>
				<p>'.esc_html($content).'</p>
			</div>
		</div>';
	}
    elseif($type == 'Feature-Style4')
    {
        $result .= '
		<div class="infobox style-3">
			<div class="icon">
				<i class="icon-'.esc_attr($icon).'"></i>
			</div>
			<div class="text">
				<h3 class="heading">'.esc_attr($text).'</h3>
				<p>
					'.esc_html($content).'
					<br>
					<a href="'.esc_url($link).'">'.esc_attr($linktext).'...</a>
				</p>
			</div>
		</div>';
    }
	elseif($type == 'Feature-Style5')
    {
        $result .= '
		<div class="infobox style-4">
			<div class="icon">
				<i class="icon-'.esc_attr($icon).'"></i>
			</div>
			<div class="text">
				<h3 class="heading">'.esc_attr($text).'</h3>
			</div>
		</div>';
    }
	elseif($type == 'Feature-Style6')
    {
        $result .= '
		<div class="infobox style-5">
			<div class="icon">
				<i class="icon-'.esc_attr($icon).'"></i>
			</div>
			<div class="text">
				<h3 class="heading">'.esc_attr($text).'</h3>
				<p>'.esc_html($content).'</p>
			</div>
		</div>';
    }
    return $section_heading = force_balance_tags( $result );
}
add_shortcode( "rms-features", "features" );