From 4b759f69ae7cd1ea12888fb0552af3474eed9a11 Mon Sep 17 00:00:00 2001 From: Rinat Khaziev Date: Tue, 10 Dec 2024 13:48:49 -0600 Subject: [PATCH] Cache-bust the asset --- vip-jetpack/vip-jetpack.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/vip-jetpack/vip-jetpack.php b/vip-jetpack/vip-jetpack.php index 8ed2d2d398..32844b3d33 100644 --- a/vip-jetpack/vip-jetpack.php +++ b/vip-jetpack/vip-jetpack.php @@ -455,7 +455,8 @@ function vip_prevent_jetpack_post_by_email_database_noise() { } ); // 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' ); +// Uncomment below line to enable the hotfix +// 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', '<' ); @@ -472,3 +473,17 @@ function vip_jetpack_disable_wpcom_block_editor() { } ); } } +// Force cache flush +add_action( 'plugins_loaded', function () { + add_filter( 'script_loader_src', + function ( $src, $handle ) { + if ( 'wpcom-block-editor-default-editor-script' === $handle ) { + return $src . '.vip'; + } + + return $src; + }, + PHP_INT_MIN, + 2 + ); +} );