Make WordPress Core

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: azaozz's profile azaozz Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: TinyMCE Keywords:
Focuses: Cc:

Description (last modified by azaozz)

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)

#1 @azaozz
6 years ago

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.

Last edited 6 years ago by azaozz (previous) (diff)

#2 @azaozz
6 years ago

  • Description modified (diff)

#3 @azaozz
6 years ago

  • Milestone 5.0 deleted
  • Resolution set to maybelater
  • Status changed from new to closed

Mistook a reported bug about this type of usage. As there aren't any reported cases, moving this to "maybelater".

Note: See TracTickets for help on using tickets.