<?php
/* Plugin Name: Style Formats Test */

add_filter( 'tiny_mce_before_init', 'styleformatstest_tiny_mce_buttons' );

function styleformatstest_tiny_mce_buttons( $init ) {
	$init['theme_advanced_buttons2_add_before'] = 'styleselect';
	
	$style_formats = array(
		array(
			'title'   => 'Button',
			'inline'  => 'a',
			'classes' => 'btn',
			
			// Adding this will overwrite an existing href attribute.
			
			// Without it, if the style is applied to any text that isn't already wrapped in an <a> tag,
			// it will be wrapped in an <a> tag without an href attribute and can't be updated.
			
			/*
			'attributes' => array(
				'href' => '#'
			)
			*/
		)
	);
	
	$init['style_formats'] = json_encode( $style_formats );
	
	return $init;
}
?>