Make WordPress Core

Opened 2 years ago

Last modified 2 years ago

#54993 new defect (bug)

Inline output using wp_enqueue_block_style adds unnecessary paths

Reported by: s56bouya's profile s56bouya Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.9
Component: Script Loader Keywords:
Focuses: Cc:


Outputting inline using wp_enqueue_block_style, adds an unnecessary path to the CSS property. I want to delete it.




Refer to (

add_action( 'after_setup_theme', function() {
    // Same args used for wp_enqueue_style().
    $args = array(
        'handle' => 'my-theme-buttons',
        'src'    => get_theme_file_uri( 'assets/blocks/buttons.css' ),
    // Add "path" to allow inlining asset if the theme opts-in.
    $args['path'] = get_theme_file_path( 'assets/blocks/buttons.css' );
    // Enqueue asset.
    wp_enqueue_block_style( 'core/buttons', $args );
} );


Output inline.

<style id='my-theme-buttons-inline-css'>

The path


is not needed. I want to delete it. Is there any solution? Or is it a bug?

Change History (1)

#1 @SergeyBiryukov
2 years ago

  • Component changed from General to Script Loader
Note: See TracTickets for help on using tickets.