From de0ff7d84555366dd2f1768dc3ef81771f557e26 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 4 Jan 2021 17:45:06 +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. Built from https://develop.svn.wordpress.org/trunk@49930 git-svn-id: http://core.svn.wordpress.org/trunk@49629 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-content/themes/twentytwentyone/inc/template-functions.php | 4 ++++ wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/wp-content/themes/twentytwentyone/inc/template-functions.php b/wp-content/themes/twentytwentyone/inc/template-functions.php index ec4efea558..4e5fcd6abe 100644 --- a/wp-content/themes/twentytwentyone/inc/template-functions.php +++ b/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; } diff --git a/wp-includes/version.php b/wp-includes/version.php index c18d13e74f..5cd3ff0737 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.7-alpha-49929'; +$wp_version = '5.7-alpha-49930'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.