* Update PageController.php

* Create fix-7758

* Minor fixes
This commit is contained in:
hellwig-data443 2021-11-17 11:36:25 -05:00 committed by GitHub
parent 2e1473a25e
commit ebcd4d9682
2 changed files with 7 additions and 1 deletions

View File

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

View File

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