10up / convert-to-blocks

Convert to Blocks is a WordPress plugin that transforms classic editor content to blocks on the fly.

Home Page:https://wordpress.org/plugins/convert-to-blocks/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Classic editor links showing all the time

helen opened this issue · comments

Is your enhancement related to a problem? Please describe.
I understand that this plugin is meant as a stepping stone from sites that are in a classic editor workflow adjusting to the block editor. However, the Classic Editor links (admin menu and h2) were unexpected to me when I had the Classic Editor plugin deactivated.

Describe the solution you'd like
I think the links should only show if the Classic Editor plugin is active.

Designs
n/a

Describe alternatives you've considered
n/a

Additional context

@helen The Classic Menu item you are seeing is from the plugin itself. This Plugin adds it's own Classic / Block Editor post editor rows which work differently that CE. Classic Editor & Convert to Blocks can't both be activated on the same site or we'll end up with 2 sets of menus like so,

Duplicate Menu Items

The plugin has hooks to change which post types to enable on, like convert_to_blocks_default_post_types. We could extend that and provide admin UI to manage which CPTs to enable on.

cc @jeffpaul

@dsawardekar in a case where someone has the Classic Editor and Convert to Blocks activated, what would be the ideal functionality in the post editor row?

@jeffpaul We could show an Admin notice that asks the User to disable 'Classic Editor' with suitable copy / link to docs. The link can be to documentation about hooks that can be used to change which post types should enable Convert To Blocks. That way only the Classic Editor plugin functionality and post row actions would show.

@dsawardekar in chatting with @helen this morning, we are thinking of allowing Classic Editor and Convert to Blocks to both be active at the same time and in this scenario Convert to Blocks would ensure that the Classic Editor row action works with the Classic Editor and would another row action to utilize the Block Editor. Is there anything in how you've built Convert to Blocks or seen it used that would make this a sub-optimal approach?

@jeffpaul Convert To Blocks works based on a ?classic=1 query param. We switch back by toggling this parameter. The Classic editor plugin uses a Post Meta flag to remember what Editor was used. If the Classic Editor plugin is active it will always override the Convert to Blocks behaviour.

I reviewed the source code of the Classic Editor plugin but did not find any hooks to control which post types CE is enabled on. If we could add a hook like classic_editor_post_types we could turn off CE on post types that have Convert to Blocks.

cc @helen

In thinking about the goal of the Convert to Blocks plugin, it would appear to be solving for the scenario: "I have a non-block editor formatted post that I want to have converted to the block editor format." Including this functionality of trying to remember and force a specific editor to open a post in does not seem close enough related to the scenario I've mentioned so I think we're better off removing that functionality entirely and focusing on singularly supporting the scenario where opening an existing non-block editor formatted post converts it to the block editor format.