Make WordPress Core

Opened 12 years ago

Closed 10 years ago

Last modified 4 years ago

#20076 closed enhancement (wontfix)

add_editor_style() should support plugins as well

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

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 (10)

#1 follow-up: @azaozz
12 years 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.

#2 in reply to: ↑ 1 @mikeschinkel
12 years 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.

#3 @ericlewis
11 years ago

  • Resolution set to wontfix
  • Status changed from new to closed

#4 @SergeyBiryukov
11 years ago

  • Component changed from General to TinyMCE
  • Milestone Awaiting Review deleted

#5 @nacin
11 years ago

  • Resolution wontfix deleted
  • Status changed from closed to reopened

#6 @SergeyBiryukov
11 years ago

  • Milestone set to Awaiting Review

#7 @c3mdigital
10 years ago

  • Keywords needs-patch added; close removed

#8 @ericlewis
10 years ago

  • Keywords needs-patch removed
  • Resolution set to wontfix
  • Status changed from reopened to closed

This is pedantic, and will probably be a non-issue with the documentation of hooks and eventual publishing on developer.wp.org. Closing out.

Last edited 10 years ago by ericlewis (previous) (diff)

#9 @ocean90
10 years ago

  • Milestone Awaiting Review deleted

This ticket was mentioned in Slack in #core-editor by andraganescu. View the logs.


4 years ago

Note: See TracTickets for help on using tickets.