Opened 15 months ago

Last modified 11 months ago

#20076 reopened enhancement

add_editor_style() should support plugins as well

Reported by: ericlewis Owned by:
Priority: normal Milestone: Awaiting Review
Component: TinyMCE Version:
Severity: normal Keywords: close
Cc: mikeschinkel@…

Description

Although plugins can use the "mce_css" filter to add stylesheets for TinyMCE, from an API standpoint this function is a bit misleading / counterintuitive. Why shouldn't plugins be allowed to use one and the same function call to load stylesheets? I know this was probably implemented for use in twentyten, but maybe it's time to expand it.

Change History (6)

comment:1 follow-up: ↓ 2   azaozz15 months ago

  • Keywords close added

Frankly I still don't see a point in having add_editor_style() at all. The whole functionality (wouldn't call it API) of add_editor_style(), the $editor_styles global and the code block in wp_editor that parses it was added with the assumption that theme authors don't know how to use filters.

However plugin authors know how to use filters, so using 'mce_css' is far better.

comment:2 in reply to: ↑ 1   mikeschinkel15 months ago

  • Cc mikeschinkel@… added

Replying to azaozz:

Frankly I still don't see a point in having add_editor_style() at all. The whole functionality (wouldn't call it API) of add_editor_style(), the $editor_styles global and the code block in wp_editor that parses it was added with the assumption that theme authors don't know how to use filters.

However plugin authors know how to use filters, so using 'mce_css' is far better.

-1 to that.

Developers may know how to use filters, but developers are really no better at finding filters that are named obscurely. 'mce_css' is probably one of the worst named hooks in WordPress in you care anything about making hook discovery easier.

  • Resolution set to wontfix
  • Status changed from new to closed
  • Component changed from General to TinyMCE
  • Milestone Awaiting Review deleted
  • Resolution wontfix deleted
  • Status changed from closed to reopened
  • Milestone set to Awaiting Review
Note: See TracTickets for help on using tickets.