WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 4 months ago

#40083 closed defect (bug) (worksforme)

if wp_editor is used in a metabox and you change 'visual' to 'text' and save, it affects the main editor too

Reported by: shamai Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: TinyMCE Keywords: close
Focuses: administration Cc:
PR Number:

Description

http://giphy.com/gifs/3o7btPiFRNQkPNH1Ys

Please view the gif above.
This shows the editor and a metabox editor using wp_editor.
When one is switched from 'visual' to 'text' the other switches on save.

Change History (2)

#1 @azaozz
3 years ago

  • Keywords close added
  • Version 4.7.3 deleted

This is expected behavior. Most users prefer either the Visual or the Text editor. The user preference for which editor to load first is "global".

In your plugin you can change the behavior by setting it to the state of one of the editors onunload. See: https://core.trac.wordpress.org/browser/tags/4.7.3/src/wp-admin/js/editor.js#L84 and https://core.trac.wordpress.org/browser/tags/4.7.3/src/wp-admin/js/editor.js#L115.

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

#2 @azaozz
4 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed

Closing as worksforme as that's the expected behaviour. Feel free to reopen with ideas and/or some (pseudo) code if this still needs changing in the classic editor.

Note: See TracTickets for help on using tickets.