From 8faefaca350656382d85a7a7ec6480cfb3ad8c91 Mon Sep 17 00:00:00 2001 From: mostafa-hisham Date: Thu, 15 Jul 2021 17:19:11 +0200 Subject: [PATCH] Fixes #567 Prevent fatal error related to get_current_screen() (#582) * check if get_current_screen exists * Fix phpcs parens spacing Co-authored-by: Caspar Green --- inc/3rd-party/yoast-seo.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/inc/3rd-party/yoast-seo.php b/inc/3rd-party/yoast-seo.php index a5edfb79f..54a719691 100755 --- a/inc/3rd-party/yoast-seo.php +++ b/inc/3rd-party/yoast-seo.php @@ -10,6 +10,9 @@ * @since 1.4.1 */ function _imagify_dequeue_yoastseo_script() { + if ( ! function_exists( 'get_current_screen' ) ) { + return; + } $current_screen = get_current_screen(); if ( isset( $current_screen ) && 'post' === $current_screen->base && 'attachment' === $current_screen->post_type ) {