<?php

function title_func( $atts, $content ) {
	extract(shortcode_atts( array(
		'size'  => 'h2',
		'style' => 'style-1',
		'id'    => ''
	), $atts ));

	$class = 'title';

	if( $id ) {
		$id = ' id="' . $id . '"';
	}

	if( $style == 'style-2' ) {
		$class = 'section-title';
	} else if( $style == 'style-3' ) {
		$class = 'heading';
	}

	return '<' . $size . ' class="' . $class . '"' . $id . '>' . do_shortcode($content) . '</' . $size . '>';
}
add_shortcode( 'title', 'title_func' );