wpsharks / s2member

s2Member® Framework (membership management for WordPress®).
64 stars 36 forks source link

Protect s2Member content and metaboxes from Gutenberg stupidity #1150

Open KTS915 opened 6 years ago

KTS915 commented 6 years ago

We all know that GB is a recipe for disaster (as evidenced by reviews on wordpress.org). It is especially problematic if a previously-created post or page is opened in GB.

Luckily, there is a simple way to protect s2Member users from having their sites corrupted by this nonsense. It just requires that the following attribute is added to the add_meta_box function in s2member/src/includes/classes/meta-boxes.inc.php:

'__block_editor_compatible_meta_box' => false

See https://wordpress.org/gutenberg/handbook/extensibility/meta-box/

The full function then becomes as follows:

add_meta_box( "ws-plugin--s2member-security", "s2Member™", "c_ws_plugin__s2member_meta_box_security::security_meta_box", $type, "side", "high", array( '__block_editor_compatible_meta_box' => false ) );
RealDavidoff commented 5 years ago

This brilliant title caught my eyes on the s2m blog and I have to comment:

I don't know if the above code only helps s2m plugin, but I use Jeff Starr's starred plugin "disable gutenberg" or so, and it covers ALL issues.

Just in case more people H . T . that gutenberg nonsense editing behavior.

We aren't kiddies, right? We don't want that "Wix" nonsense for non-website-knowledgable 90 year olds, if there are enough at all to justify trying to follow in Wix' footsteps. We all have written pages and posts for decade(s) and need no one to complicate that basic work. Thanks.

PS: You noticed I agree with the OP, didn't you? ;-)