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
This commit is contained in:
gziolo 2021-05-17 14:28:04 +00:00
parent 51fe01e66d
commit b6ba5d33bc
3 changed files with 6 additions and 6 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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.