Make sure get_current_screen() is available (#33990)
* Make sure get_current_screen is available * Add changelog
This commit is contained in:
parent
9bc4e88b1a
commit
f56b1da519
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: fix
|
||||
|
||||
Fix a fatal when a block is used in the frontend #33989
|
|
@ -52,7 +52,7 @@ class Homescreen {
|
|||
|
||||
add_filter( 'woocommerce_admin_preload_options', array( $this, 'preload_options' ) );
|
||||
|
||||
if ( Features::is_enabled( 'shipping-smart-defaults' ) ) {
|
||||
if ( Features::is_enabled( 'shipping-smart-defaults' ) && function_exists( 'get_current_screen' ) ) {
|
||||
add_filter(
|
||||
'woocommerce_admin_shared_settings',
|
||||
array( $this, 'maybe_set_default_shipping_options_on_home' ),
|
||||
|
|
Loading…
Reference in New Issue