Tests: Fix dependency tests
Fixes test_block_styles_for_editing_with_theme_support and test_block_styles_for_viewing_with_theme_support by partially reverting [49102] and only calling wp_should_load_block_editor_scripts_and_styles() when on an admin screen. Props TimothyBlynJacobs. See #51330. Built from https://develop.svn.wordpress.org/trunk@49104 git-svn-id: http://core.svn.wordpress.org/trunk@48866 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
f5c67c386f
commit
92f3ef5980
@ -2185,7 +2185,7 @@ function script_concat_settings() {
|
|||||||
* @global WP_Screen $current_screen WordPress current screen object.
|
* @global WP_Screen $current_screen WordPress current screen object.
|
||||||
*/
|
*/
|
||||||
function wp_common_block_scripts_and_styles() {
|
function wp_common_block_scripts_and_styles() {
|
||||||
if ( ! wp_should_load_block_editor_scripts_and_styles() ) {
|
if ( is_admin() && ! wp_should_load_block_editor_scripts_and_styles() ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2219,15 +2219,11 @@ function wp_common_block_scripts_and_styles() {
|
|||||||
function wp_should_load_block_editor_scripts_and_styles() {
|
function wp_should_load_block_editor_scripts_and_styles() {
|
||||||
global $current_screen;
|
global $current_screen;
|
||||||
|
|
||||||
if ( ! is_admin() ) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
$is_block_editor_screen = ( $current_screen instanceof WP_Screen ) && $current_screen->is_block_editor();
|
$is_block_editor_screen = ( $current_screen instanceof WP_Screen ) && $current_screen->is_block_editor();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filters the flag that decides whether or not block editor scripts and
|
* Filters the flag that decides whether or not block editor scripts and
|
||||||
* styles are going to be enqueued on the current admin screen.
|
* styles are going to be enqueued on the current screen.
|
||||||
*
|
*
|
||||||
* @since 5.6.0
|
* @since 5.6.0
|
||||||
*
|
*
|
||||||
@ -2247,7 +2243,7 @@ function wp_should_load_block_editor_scripts_and_styles() {
|
|||||||
function wp_enqueue_registered_block_scripts_and_styles() {
|
function wp_enqueue_registered_block_scripts_and_styles() {
|
||||||
global $current_screen;
|
global $current_screen;
|
||||||
|
|
||||||
$load_editor_scripts = wp_should_load_block_editor_scripts_and_styles();
|
$load_editor_scripts = is_admin() && wp_should_load_block_editor_scripts_and_styles();
|
||||||
|
|
||||||
$block_registry = WP_Block_Type_Registry::get_instance();
|
$block_registry = WP_Block_Type_Registry::get_instance();
|
||||||
foreach ( $block_registry->get_all_registered() as $block_name => $block_type ) {
|
foreach ( $block_registry->get_all_registered() as $block_name => $block_type ) {
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.6-alpha-49103';
|
$wp_version = '5.6-alpha-49104';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user