WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/26/2014 04:45:54 AM (5 years ago)
Author:
wonderboymusic
Message:

MCE View sandboxes:

  • Use a MutationObserver to listen to the body class of the parent editor frame.
  • In wpview_media_sandbox_styles(), only return the MEjs stylesheets.
  • In wp_ajax_parse_media_shortcode() and wp_ajax_parse_embed(), return an object instead of an HTML blob to allow passing body and head separately

Props avryl, azaozz.
Fixes #29048.

File:
1 edited

Legend:

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

    r29564 r29615  
    33113311function wpview_media_sandbox_styles() {
    33123312    $version = 'ver=' . $GLOBALS['wp_version'];
    3313     $open_sans = "//fonts.googleapis.com/css?family=Open+Sans%3A300italic%2C400italic%2C600italic%2C300%2C400%2C600&subset=latin%2Clatin-ext&ver=$version";
    3314     $dashicons = includes_url( "css/dashicons.css?$version" );
    33153313    $mediaelement = includes_url( "js/mediaelement/mediaelementplayer.min.css?$version" );
    33163314    $wpmediaelement = includes_url( "js/mediaelement/wp-mediaelement.css?$version" );
    33173315
    3318     /**
    3319      * For use by themes that need to override the styling of MediaElement based previews in the Visual editor.
    3320      * Not intended for adding editor-style.css. Ideally these styles will be applied by using
    3321      * the 'seamless' iframe attribute in the future.
    3322      *
    3323      * @since 4.0
    3324      *
    3325      * @param array The URLs to the stylesheets that will be loaded in the sandbox iframe.
    3326      */
    3327     return apply_filters( 'wpview_media_sandbox_styles', array( $open_sans, $dashicons, $mediaelement, $wpmediaelement ) );
    3328 }
     3316    return array( $mediaelement, $wpmediaelement );
     3317}
Note: See TracChangeset for help on using the changeset viewer.