Your first filter isn't correct. 'styleselect' give you and generate a dropdown on the tinyMCE. You can't add information like that.
Here is what to do.
Nice way:
First, create a separate file called 'custom_wp_admin_editor_tinymce.php' (or what ever).
Inside the function.php, include your file with the correct path where you created your previous function.
// Add the heading dropdown (x6) and add the format dropdown
include_once(TEMPLATEPATH.'/Path to you doc/custom_wp_admin_editor_tinymce.php');
Here is your 'custom_wp_admin_editor_tinymce' template.
<?php
// Add the heading dropdown (x6) and add the format dropdown
function enable_style_dropdown($buttons) {
$buttons[] = 'styleselect';
return $buttons;
}
add_filter("mce_buttons_2", "enable_style_dropdown");
function myformatTinyMCE( $in ) {
$in['block_formats'] = 'Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6';
$style_formats = array (
array( 'title' => 'bold', 'block' => 'p', 'classes' => 'bold' ),
array( 'title' => 'italic', 'block' => 'p', 'classes' => 'italic' ),
array( 'title' => 'link', 'block' => 'p', 'classes' => 'link' ),
array( 'title' => 'unlink', 'block' => 'p', 'classes' => 'unlink' ),
array( 'title' => 'bullist', 'block' => 'p', 'classes' => 'bullist' ),
array( 'title' => 'numlist', 'block' => 'p', 'classes' => 'numlist' ),
array( 'title' => 'table', 'block' => 'p', 'classes' => 'table' ),
array( 'title' => 'anchor', 'block' => 'p', 'classes' => 'anchor' )
);
$in['style_formats'] = json_encode( $style_formats );
$in['style_formats_merge'] = false;
$in['wordpress_adv_hidden'] = false;
return $in;
}
add_filter( 'tiny_mce_before_init', 'myformatTinyMCE' );
?>
Dirty way:
Past the previous code directly inside function.php