πŸ’Ž PREMIUM: Changeset/ - Uncensored 2025

Changeset 60355


Ignore:
Timestamp:
06/26/2025 07:22:53 PM (6 months ago)
Author:
audrasjb
Message:

Editor: Add cache-busting for block styles on development mode.

This changeset introduces a development mode for block editor styles. When SCRIPT_DEBUG is enabled, block editor styles now use the file modification time as their version, ensuring cache busting during development. This matches the behavior that already exists for block scripts.

Previously, block editor styles only used the version from block.json, which doesn't change during development, causing styles to be cached even after changes.

Props helgatheviking, abcd95, gziolo, whaze, audrasjb, sandeepdahiya, rollybueno.
Fixes #63254.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/blocks.php

    r60316 r60355 Β 
    329329    $style_uri       = get_block_asset_url( $style_path_norm );
    330330
    331Β     $version = ! $is_core_block && isset( $metadata['version'] ) ? $metadata['version'] : false;
    332Β     $result  = wp_register_style(
    Β 331    $block_version = ! $is_core_block && isset( $metadata['version'] ) ? $metadata['version'] : false;
    Β 332    $version       = $style_path_norm && defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? filemtime( $style_path_norm ) : $block_version;
    Β 333    $result        = wp_register_style(
    333334        $style_handle_name,
    334335        $style_uri,
Note: See TracChangeset for help on using the changeset viewer.