WordPress.org

Make WordPress Core

#42119 closed task (blessed) (fixed)

Add filter to allow replacing the editor

Reported by: azaozz Owned by: pento
Milestone: 4.9 Priority: normal
Severity: normal Version: 4.9
Component: Editor Keywords: has-patch
Focuses: Cc:

Description

Currently there is no straightforward way to fully replace the editor and the UI around it. A boolean filter before loading the editor template (edit-form-advanced.php) will make this possible.

Attachments (3)

42119.patch (2.9 KB) - added by azaozz 23 months ago.
42119.diff (1.4 KB) - added by danieltj 23 months ago.
Adds filter for the post editor to swap out to another.
42119.2.patch (3.0 KB) - added by azaozz 23 months ago.

Download all attachments as: .zip

Change History (9)

@azaozz
23 months ago

@danieltj
23 months ago

Adds filter for the post editor to swap out to another.

#1 @azaozz
23 months ago

  • Keywords has-patch added

In 42119.patch: add replace_editor filter. If it returns true do not include edit-form-advanced.php, let the plugin supply the Edit Post template.

#2 follow-up: @azaozz
23 months ago

@danieltj ugh, we doubled?

It's not enough to just replace TinyMCE. This can be done currently. This should allow replacement of the whole editor template. It opens possibilities to do "reduced" editor screens, custom editor layouts for specific post types, etc.

Last edited 23 months ago by azaozz (previous) (diff)

#3 in reply to: ↑ 2 @danieltj
23 months ago

Replying to azaozz:

@danieltj ugh, we doubled?

It's not enough to just replace TinyMCE. This can be done currently. This should allow replacement of the whole editor template. It opens possibilities to do "reduced" editor screens, custom editor layouts for specific post types, etc.

Yeah, you beat me by a minute or so!

Ah I see, that makes sense - my understanding of it was the editor itself, not the entire template. My mistake.

Last edited 23 months ago by danieltj (previous) (diff)

@azaozz
23 months ago

#4 @azaozz
23 months ago

In 42119.2.patch: add documentation for replace_editor.

#5 @pento
23 months ago

  • Owner set to pento
  • Status changed from new to accepted

#6 @pento
23 months ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 41829:

Editor: Add the replace_editor filter.

This filter allows the Core editor to be replaced by an entirely different editor (coughcoughGUTENBERGcough).

Props azaozz, who is supposed to be on sabbatical right now.
Fixes #42119.

Note: See TracTickets for help on using tickets.