Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin: Remove lingering references to integrated classic editor #13544

Merged
merged 2 commits into from
Feb 6, 2019

Conversation

aduth
Copy link
Member

@aduth aduth commented Jan 28, 2019

Closes #12888

This pull request seeks to remove all remaining references to the classic editor option which had been supported in Gutenberg versions preceding the release to WordPress 5.0. Since WordPress 5.0, this functionality has been broken in the Gutenberg plugin. Users should use the Classic Editor plugin instead for the classic editor experience.

Primarily impacted:

  • There were a handful of filters affecting the behavior of revisions to ensure that the user would be directed back to either the classic editor or the Gutenberg editor, depending on from they had arrived at the revisions screen. Since this can be assumed to be the block editor, it is no longer necessary (including the ?gutenberg query argument).
  • The "JavaScript disabled" messaging would direct the user to the (broken) classic editor experience. It now directs to the Classic Editor plugin instead.
  • While not entirely related to "classic editor", the Meta Box documentation was left outdated from the related pull request Plugin: Deprecate metabox supports, fall back to core #13449 . (Aside: This serves as testament to the fact that user-facing documentation shouldn't be written as so tied to a specific implementation, as it was already quite out of date before these changes)

Testing instructions:

Verify there are no regressions in the behavior of:

  • Navigating to and from the revisions screen
  • Disabled JavaScript messaging directing to the Classic Editor plugin

@aduth aduth added the Gutenberg Plugin Issues or PRs related to Gutenberg Plugin management related efforts label Jan 28, 2019
@youknowriad youknowriad requested a review from a team January 29, 2019 09:34
@gziolo gziolo added the Good First Review A PR that's suitable for someone looking to contribute for the first time by reviewing code label Jan 29, 2019
@gziolo gziolo added this to the 5.0 (Gutenberg) milestone Jan 29, 2019
@aduth aduth force-pushed the remove/classic-editor-param branch from 2aa49fb to f7235c6 Compare January 29, 2019 17:06
Copy link
Member

@oandregal oandregal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested this with WordPress 5.0.3.

Disabling JS

  • using Gutenberg master: I'm shown a link with &classic-editor that doesn't work.
  • using this PR: correctly points to the plugin.

Revisions

  • using Gutenberg master: when I try to navigate from a revision to the editor, I face a WSOD.
  • using this PR: I'm correctly redirected to the block editor. I've also checked that after installing and activating the classic plugin I'm redirected properly to the classic editor.

Load a post with &classic-editor

  • using Gutenberg master: WSOD.
  • using this PR: the block editor loads fine. After installing and activating the classic plugin, the classic editor is loaded instead.

I'm not very knowledgeable about meta boxes, but in the "Testing, Converting, and Maintaining Existing Meta Boxes" section, the document says:

WordPress will fall back to the Classic editor, where the meta box will continue working as before.

Explicitly setting __block_editor_compatible_meta_box to true will cause WordPress to stay in Gutenberg (assuming another meta box doesn't cause a fallback).

If we're using this PR to update the docs, perhaps that's something that we also want to tackle. Happy to address it in a follow-up PR if necessary, so that's why I approve this.

@aduth
Copy link
Member Author

aduth commented Feb 6, 2019

Thanks for the thorough testing @nosolosw !

If we're using this PR to update the docs, perhaps that's something that we also want to tackle.

I really didn't want to tackle documentation here, but a keyword search for classic-editor had me stumble upon the document in a state which was, to me, offensively inaccurate. My hope was to get it to a point of at least moderately representative, and not much more than that.

I'm not entirely clear what from your quoted text would be considered an issue. There is still a classic editor fallback for incompatible meta boxes present in core, and this is expected to continue to work today. All the same, I think further improvements should be done separately.

@aduth aduth merged commit 31b6b17 into master Feb 6, 2019
@aduth aduth deleted the remove/classic-editor-param branch February 6, 2019 20:25
@oandregal
Copy link
Member

oandregal commented Feb 6, 2019

There is still a classic editor fallback for incompatible meta boxes present in core

That's exactly what confuses me. If core doesn't provide the classic editor any more, how do we fallback to it when a meta box is incompatible?

@aduth
Copy link
Member Author

aduth commented Feb 6, 2019

There is still a classic editor fallback for incompatible meta boxes present in core

That's exactly what confuses me. If core doesn't provide the classic editor any more, how do we fallback to it when a meta box is incompatible?

I was operating on an assumption that the classic editor was still "secretly" bundled with core, and that either the presence of the Classic Editor plugin or a meta box marked with __block_editor_compatible_meta_box would just activate it.

This must have changed at some point though. Adding the meta box flag does show a message, but it's still the block editor.

image

I guess the documentation should be updated accordingly then.


Demo Code:

<?php
/**
 * Plugin name: Demo Meta
 */

function demo_meta_box_add() {
	add_meta_box(
		'demo-meta-box',
		'Demo Meta Box',
		'__return_empty_string',
		'post',
		'normal',
		'high',
		array(
			'__block_editor_compatible_meta_box' => false,
		)
	);
}
add_action( 'add_meta_boxes', 'demo_meta_box_add' );

@oandregal oandregal mentioned this pull request Feb 7, 2019
@oandregal
Copy link
Member

Follow up at #13733

youknowriad pushed a commit that referenced this pull request Mar 6, 2019
)

* Docs: Update meta box document to reflect core behavior

* Plugin: Remove lingering references to integrated Classic Editor
youknowriad pushed a commit that referenced this pull request Mar 6, 2019
)

* Docs: Update meta box document to reflect core behavior

* Plugin: Remove lingering references to integrated Classic Editor
This was referenced Apr 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Review A PR that's suitable for someone looking to contribute for the first time by reviewing code Gutenberg Plugin Issues or PRs related to Gutenberg Plugin management related efforts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants