From b6ba5d33bcd9da599e4f335e1ccb2f76d5f5b4bf Mon Sep 17 00:00:00 2001 From: gziolo Date: Mon, 17 May 2021 14:28:04 +0000 Subject: [PATCH] Editor: Rename `should_load_separate_core_block_assets` for consistency Changes introduced: - The `wp_should_load_separate_core_block_assets` function. - The `should_load_separate_core_block_assets` filter. Props hellofromTonya, SergeyBiryukov. Fixes #50328. Built from https://develop.svn.wordpress.org/trunk@50919 git-svn-id: http://core.svn.wordpress.org/trunk@50528 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/blocks.php | 2 +- wp-includes/script-loader.php | 8 ++++---- wp-includes/version.php | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/wp-includes/blocks.php b/wp-includes/blocks.php index 9a552835f7..e9dcdfbf7c 100644 --- a/wp-includes/blocks.php +++ b/wp-includes/blocks.php @@ -158,7 +158,7 @@ function register_block_style_handle( $metadata, $field_name ) { return false; } $is_core_block = isset( $metadata['file'] ) && 0 === strpos( $metadata['file'], ABSPATH . WPINC ); - if ( $is_core_block && ! should_load_separate_core_block_assets() ) { + if ( $is_core_block && ! wp_should_load_separate_core_block_assets() ) { return false; } diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 515622825a..16a5f07d09 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -1572,7 +1572,7 @@ function wp_default_styles( $styles ) { $handle = 'wp-' . $package; $path = "/wp-includes/css/dist/$package/style$suffix.css"; - if ( 'block-library' === $package && should_load_separate_core_block_assets() ) { + if ( 'block-library' === $package && wp_should_load_separate_core_block_assets() ) { $path = "/wp-includes/css/dist/$package/common$suffix.css"; } $styles->add( $handle, $path, $dependencies ); @@ -2278,7 +2278,7 @@ function wp_should_load_block_editor_scripts_and_styles() { * * @return bool Whether separate assets will be loaded or not. */ -function should_load_separate_core_block_assets() { +function wp_should_load_separate_core_block_assets() { if ( is_admin() || is_feed() || ( defined( 'REST_REQUEST' ) && REST_REQUEST ) ) { return false; } @@ -2292,7 +2292,7 @@ function should_load_separate_core_block_assets() { * @param bool $load_separate_assets Whether separate assets will be loaded or not. * Default false. */ - return apply_filters( 'separate_core_block_assets', false ); + return apply_filters( 'should_load_separate_core_block_assets', false ); } /** @@ -2306,7 +2306,7 @@ function should_load_separate_core_block_assets() { function wp_enqueue_registered_block_scripts_and_styles() { global $current_screen; - if ( should_load_separate_core_block_assets() ) { + if ( wp_should_load_separate_core_block_assets() ) { return; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 64f039081e..e99495b5af 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.8-alpha-50918'; +$wp_version = '5.8-alpha-50919'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.