[wp-trac] [WordPress Trac] #33249: Hardcoded styles in preview should be filterable

WordPress Trac noreply at wordpress.org
Mon Aug 3 21:59:47 UTC 2015

#33249: Hardcoded styles in preview should be filterable
 Reporter:  programmin    |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  TinyMCE       |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:  javascript    |
 I noticed the wp.media.views.sandboxStyles setting was removed from the
 mce-views Javascript.

 Very well, maybe it's redundant to have it coming from the head portion of
 the JSON response, and having it in a JS place that can change, is
 redundant. I looked for the filter to add the necessary styling scripts to
 style the wp-playlist or other views from the head part of the JSON
 response to the parse-media-shortcode request, and I found it's ''still''
 hardcoded in the function wp_ajax_parse_media_shortcode calls:

 function wpview_media_sandbox_styles() {
         $version = 'ver=' . $GLOBALS['wp_version'];
         $mediaelement = includes_url(
 "js/mediaelement/mediaelementplayer.min.css?$version" );
         $wpmediaelement = includes_url( "js/mediaelement/wp-
 mediaelement.css?$version" );

         return array( $mediaelement, $wpmediaelement );

 So, there is effectively ''no way'' that one can add the proper previewing
 style for their theme's players into wp-view system now.

Ticket URL: <https://core.trac.wordpress.org/ticket/33249>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list