Make WordPress Core

Changeset 55695


Ignore:
Timestamp:
04/28/2023 08:49:02 AM (10 months ago)
Author:
oandregal
Message:

Enqueue registered assets once.

This PR removes the wp_enqueue_registered_block_scripts_and_styles callback from the enqueue_block_editor_assets action.

There are two actions to enqueue block assets: enqueue_block_editor_assets and enqueue_block_assets. The former enqueues the assets to the editor and the later enqueues them to the front-end and the editor. Given wp_enqueue_registered_block_scripts_and_styles is already bound to the enqueue_block_assets (front-end and editor), it is unnecessary to bind it to enqueue_block_editor_assets (editor) as well.

This was originally introduced at [44157] and hasn't been modified since.

Props ellatrix, costdev.
Fixes #58208.

File:
1 edited

Legend:

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

    r55657 r55695  
    570570add_action( 'enqueue_block_assets', 'wp_enqueue_registered_block_scripts_and_styles' );
    571571add_action( 'enqueue_block_assets', 'enqueue_block_styles_assets', 30 );
    572 add_action( 'enqueue_block_editor_assets', 'wp_enqueue_registered_block_scripts_and_styles' );
    573572add_action( 'enqueue_block_editor_assets', 'enqueue_editor_block_styles_assets' );
    574573add_action( 'enqueue_block_editor_assets', 'wp_enqueue_editor_block_directory_assets' );
Note: See TracChangeset for help on using the changeset viewer.