From 33cde311354a3ef4186fa6a30f1555242ecf0065 Mon Sep 17 00:00:00 2001 From: mostafa Date: Wed, 7 Jul 2021 08:31:00 +0200 Subject: [PATCH 1/2] check if get_current_screen exists --- 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..f9015ddad 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 ) { From 112e56ed465c59954225348dfbefc79fdf0703ce Mon Sep 17 00:00:00 2001 From: Caspar Green Date: Thu, 8 Jul 2021 13:27:10 -0400 Subject: [PATCH 2/2] Fix phpcs parens spacing --- inc/3rd-party/yoast-seo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/3rd-party/yoast-seo.php b/inc/3rd-party/yoast-seo.php index f9015ddad..54a719691 100755 --- a/inc/3rd-party/yoast-seo.php +++ b/inc/3rd-party/yoast-seo.php @@ -10,7 +10,7 @@ * @since 1.4.1 */ function _imagify_dequeue_yoastseo_script() { - if ( ! function_exists( 'get_current_screen') ) { + if ( ! function_exists( 'get_current_screen' ) ) { return; } $current_screen = get_current_screen();