Opened 6 years ago
Closed 6 years ago
#45150 closed defect (bug) (maybelater)
Account for improper use of the TinyMCE init array filters
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | TinyMCE | Keywords: | |
Focuses: | Cc: |
Description (last modified by )
In plugins when any of the TinyMCE init array filters ('mce_external_plugins'
, 'tiny_mce_plugins'
, 'mce_buttons'
, 'mce_buttons_2'
, etc.) are used to output content, that content may appear at random location, or even be outputted before HTML headers are sent and cause PHP warnings.
Change History (3)
Note: See
TracTickets for help on using
tickets.
This seems a classic case of "doing it wrong" :) There is already a much more suitable filter,
'the_editor'
, for outputting HTML that has to appear together with the editor HTML. There are also a bunch of actions in edit-form-advanced.php that can be used.IMHO the proper thing to do here it to capture the output when the init array filters run, and if anything was outputted throw a "Doing it wrong" warning. That will fix unwanted HTML appearing at random places.
In some cases it may be possible to try to "redirect" such output to the proper filter, but that may bring other bugs/edge cases.