Skip to content

Commit

Permalink
Verbum: Fix Block Editor cache buster (#35243)
Browse files Browse the repository at this point in the history
  • Loading branch information
alshakero authored Jan 25, 2024
1 parent 3da7f1d commit 6c4705f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Verbum cache buster depended on build_meta, which is only updated on production builds. It doesn't refresh during development, giving you a stale block-editor bundle.
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,9 @@ public function enqueue_assets() {
$post_id = isset( $_GET['postid'] ) ? intval( $_GET['postid'] ) : get_queried_object_id();
$locale = get_locale();

$vbe_cache_buster = filemtime( ABSPATH . '/widgets.wp.com/verbum-block-editor/build_meta.json' );
$css_mtime = filemtime( ABSPATH . '/widgets.wp.com/verbum-block-editor/block-editor.css' );
$js_mtime = filemtime( ABSPATH . '/widgets.wp.com/verbum-block-editor/block-editor.min.js' );
$vbe_cache_buster = max( $js_mtime, $css_mtime );

wp_add_inline_script(
'verbum-settings',
Expand Down

0 comments on commit 6c4705f

Please sign in to comment.