Skip to content

Commit

Permalink
Site Logo: Prevent uploading multiple images via drag and drop (#68618)
Browse files Browse the repository at this point in the history
Co-authored-by: Mamaduka <[email protected]>
Co-authored-by: t-hamano <[email protected]>
  • Loading branch information
3 people authored Jan 13, 2025
1 parent ad8bdfe commit d039f91
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/block-library/src/site-logo/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit d039f91

Please sign in to comment.