From 4033498a5b83922faad49f0344948ceba6429676 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 4 Jan 2021 17:43:30 +0000 Subject: [PATCH] Twenty Twenty-One: Make sure filtering attachment image attributes only affects front end and not the admin area. Props denisco. Fixes #52212. git-svn-id: https://develop.svn.wordpress.org/trunk@49930 602fd350-edb4-49c9-b593-d223f7449a82 --- .../themes/twentytwentyone/inc/template-functions.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/wp-content/themes/twentytwentyone/inc/template-functions.php b/src/wp-content/themes/twentytwentyone/inc/template-functions.php index ec4efea558..4e5fcd6abe 100644 --- a/src/wp-content/themes/twentytwentyone/inc/template-functions.php +++ b/src/wp-content/themes/twentytwentyone/inc/template-functions.php @@ -417,6 +417,10 @@ add_filter( 'the_password_form', 'twenty_twenty_one_password_form' ); */ function twenty_twenty_one_get_attachment_image_attributes( $attr, $attachment, $size ) { + if ( is_admin() ) { + return $attr; + } + if ( isset( $attr['class'] ) && false !== strpos( $attr['class'], 'custom-logo' ) ) { return $attr; }