Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#36985 closed enhancement (duplicate)

Allow editor stylesheet on frontend

Reported by: webmandesign's profile 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)

36985.patch (493 bytes) - added by webmandesign 8 years ago.
Making add_editor_style() application more flexible, patching #36985

Download all attachments as: .zip

Change History (6)

#1 @webmandesign
8 years ago

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

#2 @SergeyBiryukov
8 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #34882.

#3 @webmandesign
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?

@webmandesign
8 years ago

Making add_editor_style() application more flexible, patching #36985

#4 @webmandesign
8 years ago

  • Keywords has-patch added

#5 @azaozz
8 years ago

  • Focuses ui accessibility administration removed
  • Resolution set to duplicate
  • Status changed from reopened to closed

Hi @webmandesign, I'm not sure adding yet another filter is the best way to go. Also this is still a duplicate of #34882. Lets continue there.

Note: See TracTickets for help on using tickets.