Make WordPress Core

Opened 11 years ago

Closed 10 years ago

#29137 closed enhancement (invalid)

Allow to add the stylesheets version in TinyMCE (or any other param)

Reported by: greglone's profile GregLone Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.3
Component: TinyMCE Keywords:
Focuses: Cc:

Description

As a front-end developer, it's really a pain in the *$* to not be able to add a version parameter to my stylesheets URL in TinyMCE: the modifications won't show up because of the cache.
So far, I had a workaround by filtering 'mce_css'. But with the new iframes used for the self-hosted videos/audios in WP 4.0, I can't use this filter there (BTW, are you sure to keep those awful iframes? :s). Even worse, some iframes don't use the stylesheets (tweets for example).

Attachments (3)

params-in-editor-stylesheets.diff (980 bytes) - added by GregLone 11 years ago.
editor_stylesheets-filter.diff (673 bytes) - added by GregLone 11 years ago.
editor_stylesheets-filter-2.diff (1.1 KB) - added by GregLone 11 years ago.
Renamed filter, add a new one, better comment blocks.

Download all attachments as: .zip

Change History (10)

#1 follow-up: @wonderboymusic
11 years ago

Without the iframes, compatibility is gross: https://core.trac.wordpress.org/ticket/28905#comment:6

#2 in reply to: ↑ 1 @GregLone
11 years ago

Replying to wonderboymusic:

Without the iframes, compatibility is gross: https://core.trac.wordpress.org/ticket/28905#comment:6

OK, if those iframes improve the compatibility, I won't complain anymore :) (well, maybe a little sometimes =D). Looking at your test results, it's impressive, congrats.

#3 @GregLone
11 years ago

On second though, file_exists can mess with other things: if you use cache busting for example.
Perhaps a filter is a better solution.
See the attached diff file.

@GregLone
11 years ago

Renamed filter, add a new one, better comment blocks.

#4 @GregLone
11 years ago

OK, I found a way to use parameters.
Instead of:

add_editor_style( 'res/css/editor-style.css?v=1234' );

Simply do:

add_editor_style( get_stylesheet_directory_uri() . '/res/css/editor-style.css?v=1234' );

This way, WordPress won't try any file_exists().
Simple and stupid :|

#5 @iseulde
10 years ago

  • Component changed from Editor to TinyMCE
  • Focuses administration removed

#6 @GregLone
10 years ago

Should we close this ticket as invalid?

#7 @iseulde
10 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.