Make WordPress Core

Ticket #30187: class-wp-editor.php.diff

File class-wp-editor.php.diff, 3.4 KB (added by dancameron, 11 years ago)

theme_styles option: Whether to add theme editor styles. Default true.

  • src/wp-includes/class-wp-editor.php

     
    5050         *     @type string     $editor_css        Intended for extra styles for both Visual and Text editors.
    5151         *                                         Should include <style> tags, and can use "scoped". Default empty.
    5252         *     @type string     $editor_class      Extra classes to add to the editor textarea elemen. Default empty.
     53         *     @type bool       $theme_styles      Whether to add theme editor styles. Default true.
    5354         *     @type bool       $teeny             Whether to output the minimal editor config. Examples include
    5455         *                                         Press This and the Comment editor. Default false.
    5556         *     @type bool       $dfw               Whether to replace the default fullscreen with "Distraction Free
     
    8687                        'tabfocus_elements' => ':prev,:next',
    8788                        'editor_css'        => '',
    8889                        'editor_class'      => '',
     90                        'theme_styles'      => true,
    8991                        'teeny'             => false,
    9092                        'dfw'               => false,
    9193                        'tinymce'           => true,
     
    177179                                $switch_class = 'tmce-active';
    178180                        }
    179181
    180                         $buttons .= '<button type="button" id="' . $editor_id . '-tmce" class="wp-switch-editor switch-tmce" onclick="switchEditors.switchto(this);">' . __('Visual') . "</button>\n";
    181                         $buttons .= '<button type="button" id="' . $editor_id . '-html" class="wp-switch-editor switch-html" onclick="switchEditors.switchto(this);">' . _x( 'Text', 'Name for the Text editor tab (formerly HTML)' ) . "</button>\n";
     182                        $buttons .= '<a id="' . $editor_id . '-html" class="wp-switch-editor switch-html" onclick="switchEditors.switchto(this);">' . _x( 'Text', 'Name for the Text editor tab (formerly HTML)' ) . "</a>\n";
     183                        $buttons .= '<a id="' . $editor_id . '-tmce" class="wp-switch-editor switch-tmce" onclick="switchEditors.switchto(this);">' . __('Visual') . "</a>\n";
    182184                }
    183185
    184186                $wrap_class = 'wp-core-ui wp-editor-wrap ' . $switch_class;
     
    489491                                        'entities' => '38,amp,60,lt,62,gt',
    490492                                        'entity_encoding' => 'raw',
    491493                                        'keep_styles' => false,
    492                                         'cache_suffix' => 'wp-mce-' . $GLOBALS['tinymce_version'],
    493494
    494495                                        // Limit the preview styles in the menu/toolbar
    495496                                        'preview_styles' => 'font-family font-size font-weight font-style text-decoration text-transform',
     
    513514                                        self::$baseurl . '/skins/wordpress/wp-content.css?' . $version
    514515                                );
    515516
    516                                 $editor_styles = get_editor_stylesheets();
    517                                 if ( ! empty( $editor_styles ) ) {
    518                                         foreach ( $editor_styles as $style ) {
    519                                                 $mce_css[] = $style;
     517                                if ( $set['theme_styles'] ) {
     518                                        $editor_styles = get_editor_stylesheets();
     519                                        if ( ! empty( $editor_styles ) ) {
     520                                                foreach ( $editor_styles as $style ) {
     521                                                        $mce_css[] = $style;
     522                                                }
    520523                                        }
    521524                                }
     525                               
    522526
    523527                                /**
    524528                                 * Filter the comma-delimited list of stylesheets to load in TinyMCE.
     
    601605                                }
    602606                        }
    603607
    604                         $body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) );
    605 
    606608                        if ( !empty($set['tinymce']['body_class']) ) {
    607609                                $body_class .= ' ' . $set['tinymce']['body_class'];
    608610                                unset($set['tinymce']['body_class']);
     
    14331435                </div>
    14341436                <?php
    14351437        }
    1436 }
     1438}
     1439 No newline at end of file