Make WordPress Core

Ticket #18141: remove-spacers.patch

File remove-spacers.patch, 2.6 KB (added by azaozz, 12 years ago)
  • wp-includes/class-wp-editor.php

     
    359359                        }
    360360
    361361                        if ( $set['teeny'] ) {
    362                                 $mce_buttons = apply_filters( 'teeny_mce_buttons', array('bold', 'italic', 'underline', 'blockquote', 'separator', 'strikethrough', 'bullist', 'numlist', 'justifyleft', 'justifycenter', 'justifyright', 'undo', 'redo', 'link', 'unlink', 'fullscreen'), $editor_id );
     362                                $mce_buttons = apply_filters( 'teeny_mce_buttons', array('bold', 'italic', 'underline', 'blockquote', 'strikethrough', 'bullist', 'numlist', 'justifyleft', 'justifycenter', 'justifyright', 'undo', 'redo', 'link', 'unlink', 'fullscreen'), $editor_id );
    363363                                $mce_buttons_2 = $mce_buttons_3 = $mce_buttons_4 = array();
    364364                        } else {
    365                                 $mce_buttons = apply_filters('mce_buttons', array('bold', 'italic', 'strikethrough', '|', 'bullist', 'numlist', 'blockquote', '|', 'justifyleft', 'justifycenter', 'justifyright', '|', 'link', 'unlink', 'wp_more', '|', 'spellchecker', 'fullscreen', 'wp_adv' ), $editor_id);
    366                                 $mce_buttons_2 = apply_filters('mce_buttons_2', array( 'formatselect', 'underline', 'justifyfull', 'forecolor', '|', 'pastetext', 'pasteword', 'removeformat', '|', 'charmap', '|', 'outdent', 'indent', '|', 'undo', 'redo', 'wp_help' ), $editor_id);
     365                                $mce_buttons = apply_filters('mce_buttons', array('bold', 'italic', 'strikethrough', 'bullist', 'numlist', 'blockquote', 'justifyleft', 'justifycenter', 'justifyright', 'link', 'unlink', 'wp_more', 'spellchecker', 'fullscreen', 'wp_adv' ), $editor_id);
     366                                $mce_buttons_2 = apply_filters('mce_buttons_2', array( 'formatselect', 'underline', 'justifyfull', 'forecolor', 'pastetext', 'pasteword', 'removeformat', 'charmap', 'outdent', 'indent', 'undo', 'redo', 'wp_help' ), $editor_id);
    367367                                $mce_buttons_3 = apply_filters('mce_buttons_3', array(), $editor_id);
    368368                                $mce_buttons_4 = apply_filters('mce_buttons_4', array(), $editor_id);
    369369                        }
    370370
     371                        $mce_buttons = array_filter( $mce_buttons, 'self::_remove_separators' );
     372                        $mce_buttons_2 = array_filter( $mce_buttons_2, 'self::_remove_separators' );
     373                        $mce_buttons_3 = array_filter( $mce_buttons_3, 'self::_remove_separators' );
     374                        $mce_buttons_4 = array_filter( $mce_buttons_4, 'self::_remove_separators' );
     375
    371376                        $body_class = $editor_id;
    372377
    373378                        if ( $post = get_post() )
     
    428433                } // end if self::$this_tinymce
    429434        }
    430435
     436        private static function _remove_separators($in) {
     437                if ( '|' == $in || 'separator' == $in )
     438                        return false;
     439                return true;
     440        }
     441
    431442        private static function _parse_init($init) {
    432443                $options = '';
    433444