Opened 8 years ago
Closed 8 years ago
#36985 closed enhancement (duplicate)
Allow editor stylesheet on frontend
Reported by: | webmandesign | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.5.2 |
Component: | Editor | Keywords: | has-patch |
Focuses: | Cc: |
Description
Certain plugins use TinyMCE editor on frontend of the website. Such as Beaver Builder page builder.
When a theme uses an editor stylesheet, this is being loaded in WordPress admin only currently, which creates inconsistency in using editor on frontend.
Could the early exit admin check be removed from add_editor_style() function, or at least made filterable?
Attachments (1)
Change History (6)
#2
@
8 years ago
- Milestone Awaiting Review deleted
- Resolution set to duplicate
- Status changed from new to closed
Duplicate of #34882.
#3
@
8 years ago
- Resolution duplicate deleted
- Status changed from closed to reopened
Adding an editor stylesheet(s) is responsibility of the theme, right?
In that case a plugin using the TinyMCE editor on frontend doesn't know about what editor stylesheets the theme includes. So, using mce_css
filter in plugin doesn't make sense really.
Likewise, if the theme wants its editor stylesheets to be frontend available, it should hook to mce_css
right from the start. Then what point there is to use add_editor_style()
?
I've proposed the way which filters the ! is_admin()
conditional inside add_editor_style()
, so a theme can use add_editor_style()
as usually, while a plugin which uses TinyMCE editor on frontend can hook onto the conditional and change it when needed so it allows theme editor stylesheets in frontend editor.
What do you think about that?
I've tried to submit a GitHub repo patch via https://rmccue.io/patch/ but I'm stuck at step 5 getting a JS error.
So, here is a patch reference: https://github.com/WordPress/WordPress/pull/213