Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#42119 closed task (blessed) (fixed)

Add filter to allow replacing the editor

Reported by: azaozz's profile azaozz Owned by: pento's profile 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 7 years ago.
42119.diff (1.4 KB) - added by danieltj 7 years ago.
Adds filter for the post editor to swap out to another.
42119.2.patch (3.0 KB) - added by azaozz 7 years ago.

Download all attachments as: .zip

Change History (9)

@azaozz
7 years ago

@danieltj
7 years ago

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

#1 @azaozz
7 years 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
7 years 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 7 years ago by azaozz (previous) (diff)

#3 in reply to: ↑ 2 @danieltj
7 years 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 7 years ago by danieltj (previous) (diff)

@azaozz
7 years ago

#4 @azaozz
7 years ago

In 42119.2.patch: add documentation for replace_editor.

#5 @pento
7 years ago

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

#6 @pento
7 years 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.