From d039f916823698848c7732f93c4b4d0dd860be90 Mon Sep 17 00:00:00 2001 From: George Mamadashvili Date: Mon, 13 Jan 2025 08:34:10 +0400 Subject: [PATCH] Site Logo: Prevent uploading multiple images via drag and drop (#68618) Co-authored-by: Mamaduka Co-authored-by: t-hamano --- packages/block-library/src/site-logo/edit.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/block-library/src/site-logo/edit.js b/packages/block-library/src/site-logo/edit.js index 5bcfafac9f3a08..6d3eda830878ec 100644 --- a/packages/block-library/src/site-logo/edit.js +++ b/packages/block-library/src/site-logo/edit.js @@ -506,6 +506,11 @@ export default function LogoEdit( { }; const onFilesDrop = ( filesList ) => { + if ( filesList?.length > 1 ) { + onUploadError( __( 'Only one image can be used as a site logo.' ) ); + return; + } + getSettings().mediaUpload( { allowedTypes: ALLOWED_MEDIA_TYPES, filesList,