- if ( $teeny ) {
- $mce_buttons = apply_filters( 'teeny_mce_buttons', array('bold, italic, underline, blockquote, separator, strikethrough, bullist, numlist,justifyleft, justifycenter, justifyright, undo, redo, link, unlink, fullscreen') );
- $mce_buttons = implode($mce_buttons, ',');
- $mce_buttons_2 = $mce_buttons_3 = $mce_buttons_4 = '';
- } else {
- $mce_buttons = apply_filters('mce_buttons', array('bold', 'italic', 'strikethrough', '|', 'bullist', 'numlist', 'blockquote', '|', 'justifyleft', 'justifycenter', 'justifyright', '|', 'link', 'unlink', 'wp_more', '|', 'spellchecker', 'fullscreen', 'wp_adv' ));
- $mce_buttons = implode($mce_buttons, ',');
-
- $mce_buttons_2 = array('formatselect', 'underline', 'justifyfull', 'forecolor', '|', 'pastetext', 'pasteword', 'removeformat', '|', 'media', 'charmap', '|', 'outdent', 'indent', '|', 'undo', 'redo', 'wp_help' );
- if ( is_multisite() )
- unset( $mce_buttons_2[ array_search( 'media', $mce_buttons_2 ) ] );
- $mce_buttons_2 = apply_filters('mce_buttons_2', $mce_buttons_2);
- $mce_buttons_2 = implode($mce_buttons_2, ',');
-
- $mce_buttons_3 = apply_filters('mce_buttons_3', array());
- $mce_buttons_3 = implode($mce_buttons_3, ',');
-
- $mce_buttons_4 = apply_filters('mce_buttons_4', array());
- $mce_buttons_4 = implode($mce_buttons_4, ',');
- }
- $no_captions = (bool) apply_filters( 'disable_captions', '' );
-
- // TinyMCE init settings
- $initArray = array (
- 'mode' => 'specific_textareas',
- 'editor_selector' => 'theEditor',
- 'width' => '100%',
- 'theme' => 'advanced',
- 'skin' => 'wp_theme',
- 'theme_advanced_buttons1' => $mce_buttons,
- 'theme_advanced_buttons2' => $mce_buttons_2,
- 'theme_advanced_buttons3' => $mce_buttons_3,
- 'theme_advanced_buttons4' => $mce_buttons_4,
- 'language' => $mce_locale,
- 'spellchecker_languages' => $mce_spellchecker_languages,
- 'theme_advanced_toolbar_location' => 'top',
- 'theme_advanced_toolbar_align' => 'left',
- 'theme_advanced_statusbar_location' => 'bottom',
- 'theme_advanced_resizing' => true,
- 'theme_advanced_resize_horizontal' => false,
- 'dialog_type' => 'modal',
- 'relative_urls' => false,
- 'remove_script_host' => false,
- 'convert_urls' => false,
- 'apply_source_formatting' => false,
- 'remove_linebreaks' => true,
- 'gecko_spellcheck' => true,
- 'entities' => '38,amp,60,lt,62,gt',
- 'accessibility_focus' => true,
- 'tabfocus_elements' => 'major-publishing-actions',
- 'media_strict' => false,
- 'paste_remove_styles' => true,
- 'paste_remove_spans' => true,
- 'paste_strip_class_attributes' => 'all',
- 'wpeditimage_disable_captions' => $no_captions,
- 'plugins' => $plugins
- );
-
- if ( ! empty( $editor_styles ) && is_array( $editor_styles ) ) {
- $mce_css = array();
- $style_uri = get_stylesheet_directory_uri();
- if ( TEMPLATEPATH == STYLESHEETPATH ) {
- foreach ( $editor_styles as $file )
- $mce_css[] = "$style_uri/$file";
- } else {
- $style_dir = get_stylesheet_directory();
- $template_uri = get_template_directory_uri();
- $template_dir = get_template_directory();
- foreach ( $editor_styles as $file ) {
- if ( file_exists( "$style_dir/$file" ) )
- $mce_css[] = "$style_uri/$file";
- if ( file_exists( "$template_dir/$file" ) )
- $mce_css[] = "$template_uri/$file";
- }
- }
- $mce_css = implode( ',', $mce_css );
- } else {
- $mce_css = '';