Skip to content

Commit

Permalink
Site Editor: Fix image upload - Check for a numeric post id before ap…
Browse files Browse the repository at this point in the history
…pending to upload media data (#57040)
  • Loading branch information
glendaviesnz authored and fullofcaffeine committed Jan 6, 2024
1 parent 909c299 commit 855178c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/editor/src/utils/media-upload/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ export default function mediaUpload( {
const wpAllowedMimeTypes = getEditorSettings().allowedMimeTypes;
maxUploadFileSize =
maxUploadFileSize || getEditorSettings().maxUploadFileSize;

const currentPostId = getCurrentPostId();
uploadMedia( {
allowedTypes,
filesList,
onFileChange,
additionalData: {
post: getCurrentPostId(),
...( ! isNaN( currentPostId ) ? { post: currentPostId } : {} ),
...additionalData,
},
maxUploadFileSize,
Expand Down

0 comments on commit 855178c

Please sign in to comment.