diff --git a/plugins/woocommerce-admin/changelogs/fix-7758 b/plugins/woocommerce-admin/changelogs/fix-7758 new file mode 100644 index 00000000000..9991c177ea5 --- /dev/null +++ b/plugins/woocommerce-admin/changelogs/fix-7758 @@ -0,0 +1,6 @@ +Significance: minor +Type: Fix + +Fix an issue with the code that makes use of an invalid parameter +with a PHP function. The use of this invalid parameter causes PHP 8 to +throw a Fatal Error. #7855 diff --git a/plugins/woocommerce-admin/src/PageController.php b/plugins/woocommerce-admin/src/PageController.php index 6d1a09b94fa..c8e54eec34a 100644 --- a/plugins/woocommerce-admin/src/PageController.php +++ b/plugins/woocommerce-admin/src/PageController.php @@ -356,7 +356,7 @@ class PageController { // Disable embed on the block editor. $current_screen = did_action( 'current_screen' ) ? get_current_screen() : false; - if ( method_exists( $current_screen, 'is_block_editor' ) && $current_screen->is_block_editor() ) { + if ( ! empty( $current_screen ) && method_exists( $current_screen, 'is_block_editor' ) && $current_screen->is_block_editor() ) { $is_connected_page = false; }