Make WordPress Core


Ignore:
Timestamp:
07/15/2014 09:50:41 PM (11 years ago)
Author:
wonderboymusic
Message:

Make audio and video URLs/embed handlers work in <iframe>-sandbox'd MCE views.

Introduce:
get_editor_stylesheets()
wp_media_mce_styles().

See #28905.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/media.php

    r29164 r29176  
    32573257    }
    32583258}
     3259
     3260/**
     3261 * Return the URls for CSS files used in an <iframe>-sandbox'd TinyMCE media view
     3262 *
     3263 * @since 4.0.0
     3264 *
     3265 * @global $wp_version
     3266 * @return array The relevant CSS file URLs.
     3267 */
     3268function wp_media_mce_styles() {
     3269    $version = 'ver=' . $GLOBALS['wp_version'];
     3270    $tinymce = includes_url( "js/tinymce/skins/lightgray/content.min.css?$version" );
     3271    $dashicons = includes_url( "css/dashicons.css?$version" );
     3272    $skin = includes_url( "js/tinymce/skins/wordpress/wp-content.css?$version" );
     3273    $mediaelement = includes_url( "js/mediaelement/mediaelementplayer.min.css?$version" );
     3274    $wpmediaelement = includes_url( "js/mediaelement/wp-mediaelement.css?$version" );
     3275
     3276    $mce_styles = array( $tinymce, $dashicons, $skin, $mediaelement, $wpmediaelement );
     3277    $editor_styles = get_editor_stylesheets();
     3278    if ( ! empty( $editor_styles ) ) {
     3279        foreach ( $editor_styles as $style ) {
     3280            $mce_styles[] = $style;
     3281        }
     3282    }
     3283    return $mce_styles;
     3284}
Note: See TracChangeset for help on using the changeset viewer.