Skip to content

Commit

Permalink
Fixes #567 Prevent fatal error related to get_current_screen() (#582)
Browse files Browse the repository at this point in the history
* check if get_current_screen exists

* Fix phpcs parens spacing

Co-authored-by: Caspar Green <[email protected]>
  • Loading branch information
mostafa-hisham and iCaspar authored Jul 15, 2021
1 parent fca13c8 commit 8faefac
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions inc/3rd-party/yoast-seo.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down

0 comments on commit 8faefac

Please sign in to comment.