Make WordPress Core

Changes between Initial Version and Version 2 of Ticket #64846


Ignore:
Timestamp:
03/12/2026 12:35:19 AM (2 months ago)
Author:
westonruter
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #64846

    • Property Focuses css added
  • Ticket #64846 – Description

    initial v2  
    6262If the `init` priority of `wp_load_classic_theme_block_styles_on_demand()` is changed to `-1` then this fixes the problem, but this is not the ideal solution since a theme/plugin could always register a style earlier during the `init` action (e.g. `PHP_INT_MIN`). Note that the `init` action is the earliest point to register a style safely since `_wp_scripts_maybe_doing_it_wrong()` will issue a warning otherwise. Nevertheless, the better solution would be to not use the `init` action at all, but rather to use the `wp_default_styles` action (with a low priority) so that we'll be better guaranteed that the filters will have been added.
    6363
     64== Reproduction ==
     65
     66Activate this plugin:
     67
     68{{{#!php
     69<?php
     70<?php
     71/**
     72 * Plugin Name: Register test style at early init.
     73 * Plugin URI: https://core.trac.wordpress.org/ticket/64846
     74 */
     75
     76add_action(
     77        'init',
     78        function () {
     79                wp_register_style( 'test-early-init', false );
     80                wp_add_inline_style( 'test-early-init', '/* With a classic theme active, make sure wp-block-library is common.css and not style.css */' );
     81                wp_enqueue_style( 'test-early-init' );
     82        },
     83        0
     84);
     85}}}
     86
     87This will reproduce the aforementioned issue observed with Elementor.