Make WordPress Core

Opened 6 years ago

Closed 2 years ago

#36223 closed defect (bug) (maybelater)

Editor statusbar not correctly toggled when wordpress_adv_hidden is set to false.

Reported by: dorapen Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.4.2
Component: TinyMCE Keywords:
Focuses: Cc:


When wordpress_adv_hidden option is set to false for TinyMCE, the behaviour of kitchen sink button is inconsistent.
The advanced menu bar shows by default as above option is set to false, however the statusbar has "visibility: hidden" style added after it has been loaded.
And when the toggle button is pressed, the menu bar goes away and statusbar appears.

When toggle button is pressed several times to match default behaviour (as same as above optioin is set to true) and page is reloaded, now the behaviour works as normal again.

This is due to mishandled 'hidetb' value in wp-includes/js/tinymce/plugins/wordpress/plugin.js, which also effect 'advanced' variable in wp-admin/js/editor-expand.js, in which styling for statusbar is toggled.

Specifically it is line 78 of wp-includes/js/tinymce/plugins/wordpress/plugin.js, as follows:

// Hide the toolbars after loading
editor.on( 'PostRender', function() {
  if ( editor.getParam( 'wordpress_adv_hidden', true ) && getUserSetting( 'hidetb', '0' ) === '0' ) {
    toggleToolbars( 'hide' );

This part of code does not handle the case of wordpress_adv_hidden set to false, which I believe is causing the problem.

Attachments (1)

screenshot.jpg (123.0 KB) - added by dorapen 6 years ago.
Screenshot of statusbar misbehaviour

Download all attachments as: .zip

Change History (3)

6 years ago

Screenshot of statusbar misbehaviour

This ticket was mentioned in Slack in #core-editor by azaozz. View the logs.

5 years ago

#2 @azaozz
2 years ago

  • Resolution set to maybelater
  • Status changed from new to closed

Re-testing again, still seems to initially hide the editor statusbar when wordpress_adv_hidden is set to false and getUserSetting( 'hidetb' ) is 0.

Wondering if it's worth fixing since this is a minor UI error on the old Edit Post screen that "fixes itself" after the first use. If yes, the place to fix it would be in editor-expand.js. The conditional there should match the same conditional in the tinymce/plugins/wordpress/plugin.js.

Closing as maybelater. Feel free to reopen with a patch.

Note: See TracTickets for help on using tickets.