Make WordPress Core


Ignore:
Timestamp:
07/18/2013 06:11:43 PM (13 years ago)
Author:
ryan
Message:

Allow absolute URLs in editor styles.

Props nacin, obenland
fixes #24787

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/class-wp-editor.php

    r24545 r24735  
    153153
    154154    public static function editor_settings($editor_id, $set) {
    155         global $editor_styles;
    156155        $first_run = false;
    157156
     
    354353
    355354                // load editor_style.css if the current theme supports it
    356                 if ( ! empty( $editor_styles ) && is_array( $editor_styles ) ) {
     355                if ( ! empty( $GLOBALS['editor_styles'] ) && is_array( $GLOBALS['editor_styles'] ) ) {
     356                    $editor_styles = $GLOBALS['editor_styles'];
     357
    357358                    $mce_css = array();
    358                     $editor_styles = array_unique($editor_styles);
     359                    $editor_styles = array_unique( array_filter( $editor_styles ) );
    359360                    $style_uri = get_stylesheet_directory_uri();
    360361                    $style_dir = get_stylesheet_directory();
    361362
     363                    // Support externally referenced styles (like, say, fonts).
     364                    foreach ( $editor_styles as $key => $file ) {
     365                        if ( preg_match( '~^(https?:)?//~', $file ) ) {
     366                            $mce_css[] = esc_url_raw( $file );
     367                            unset( $editor_styles[ $key ] );
     368                        }
     369                    }
     370
     371                    // Look in a parent theme first, that way child theme CSS overrides.
    362372                    if ( is_child_theme() ) {
    363373                        $template_uri = get_template_directory_uri();
Note: See TracChangeset for help on using the changeset viewer.