Skip to content

Commit

Permalink
Implement platform-wide mitigation for wpcom-block-editor breakage
Browse files Browse the repository at this point in the history
  • Loading branch information
rinatkhaziev committed Dec 10, 2024
1 parent c82dc65 commit 240dfb2
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions vip-jetpack/vip-jetpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -453,3 +453,22 @@ function vip_prevent_jetpack_post_by_email_database_noise() {
require_once __DIR__ . '/jetpack-sso-dummy.php';
}
} );

// https://lobby.vip.wordpress.com/2024/12/10/notice-editor-issues-when-using-jetpack-version-13-7-and-wordpress-version-6-5/
add_action( 'plugins_loaded', 'vip_jetpack_disable_wpcom_block_editor' );
function vip_jetpack_disable_wpcom_block_editor() {
global $wp_version;
$matching_jetpack_constraints = defined( 'JETPACK__VERSION' ) && version_compare( JETPACK__VERSION, '13.7', '<' );
$matching_core_contstraints = version_compare( $wp_version, '6.6', '<' );

if ( $matching_jetpack_constraints && $matching_core_contstraints ) {
add_filter( 'jetpack_tools_to_include', function ( $tools ) {
$key = array_search( 'wpcom-block-editor/class-jetpack-wpcom-block-editor.php', $tools );

if ( $key ) {
unset( $tools[ $key ] );
}
return $tools;
} );
}
}

0 comments on commit 240dfb2

Please sign in to comment.