Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename load_separate_block_styles to load_separate_block_assets #29703

Merged
merged 1 commit into from
Mar 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ function gutenberg_reregister_core_block_types() {
* @return void
*/
function gutenberg_register_core_block_styles( $block_name ) {
if ( ! gutenberg_should_load_separate_block_styles() ) {
if ( ! gutenberg_should_load_separate_block_assets() ) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/client-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ function gutenberg_register_packages_styles( $styles ) {
);
$styles->add_data( 'wp-components', 'rtl', 'replace' );

$block_library_filename = gutenberg_should_load_separate_block_styles() ? 'common' : 'style';
$block_library_filename = gutenberg_should_load_separate_block_assets() ? 'common' : 'style';
gutenberg_override_style(
$styles,
'wp-block-library',
Expand Down
6 changes: 3 additions & 3 deletions lib/compat.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function gutenberg_add_date_settings_timezone( $scripts ) {
*
* @return bool
*/
function gutenberg_should_load_separate_block_styles() {
function gutenberg_should_load_separate_block_assets() {
$load_separate_styles = gutenberg_is_fse_theme();
/**
* Determine if separate styles will be loaded for blocks on-render or not.
Expand All @@ -93,7 +93,7 @@ function gutenberg_should_load_separate_block_styles() {
*
* @return bool
*/
return apply_filters( 'load_separate_block_styles', $load_separate_styles );
return apply_filters( 'load_separate_block_assets', $load_separate_styles );
}

/**
Expand All @@ -102,7 +102,7 @@ function gutenberg_should_load_separate_block_styles() {
* @return void
*/
function gutenberg_remove_hook_wp_enqueue_registered_block_scripts_and_styles() {
if ( gutenberg_should_load_separate_block_styles() ) {
if ( gutenberg_should_load_separate_block_assets() ) {
/**
* Avoid enqueueing block assets of all registered blocks for all posts, instead
* deferring to block render mechanics to enqueue scripts, thereby ensuring only
Expand Down