bobbingwide / oik-block

Gut feel - helps you form Gutenberg compatibility opinions
GNU General Public License v3.0
1 stars 0 forks source link

Create a Preferred Editor meta box #18

Open bobbingwide opened 6 years ago

bobbingwide commented 6 years ago

As part of the effort to determine Gutenberg’s compatibility with an existing site’s content we need to drill down into each individual post to evaluate which editor would be the recommended editor for the current content. From these figures we can attempt to determine the overall compatibility of the Block editor with the site’s content.

Each post can be evaluated for compatibility with the Block editor and can be assigned a preferred editor state.

Preferred editor Label Compatible? Notes
A Any / Ambivalent Yes Not deemed incompatible
B Block Yes Already converted to blocks
C Classic No Deemed incompatible
? Unknown Yes Assumed compatible until analysed

Any post which has not yet been analysed may be considered to be in an Unknown state - equivalent to A.

Each ‘editable’ post type can also be classified as A, B or C For the [content] shortcode 5 different post type classifications were produced. There should have been 6. This table maps the classifications.

Classification Content Notes
A Gutenberg Block editor capable
B Block Must be edited using the block editor
C Classic Must be edited using the classic editor
? Media
? Revision
? n/a

Note: Post types classified as B do not yet exist.

Proposed solution

bobbingwide commented 6 years ago

I did think of an example where Preferred editor ‘A’ could actually be Mandatory. I can’t remember why exactly. Possibly something to do with the user wanting to be able to use either editor even though the opinions suggest that ‘B’ or ‘C’ is mandatory. The routine that evaluates opinions should take this into account.

bobbingwide commented 3 years ago

It's now mid June 2021. I don't need this meta box anymore. Certainly not in the block editor. Perhaps the routine should only display the block in the Classic editor. The simplest solution might be to make it appear that the meta box is not compatible with the block editor. by setting __block_editor_compatible_meta_box to false. or __back_compat_meta_box to true.

See https://developer.wordpress.org/block-editor/how-to-guides/backward-compatibility/meta-box/

Even though I've not created a block to display this information, the second option seems preferable.