From 9c55bef36e3190e74e5864f0b3a56989b12f7509 Mon Sep 17 00:00:00 2001 From: Lourens Schep Date: Tue, 17 Dec 2024 11:40:45 +0100 Subject: [PATCH] Handle post ids as numbers --- packages/edit-site/src/components/post-edit/index.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/edit-site/src/components/post-edit/index.js b/packages/edit-site/src/components/post-edit/index.js index 97484c89ed670b..afcd814d43b7d7 100644 --- a/packages/edit-site/src/components/post-edit/index.js +++ b/packages/edit-site/src/components/post-edit/index.js @@ -33,7 +33,14 @@ const fieldsWithBulkEditSupport = [ ]; function PostEditForm( { postType, postId } ) { - const ids = useMemo( () => postId.split( ',' ), [ postId ] ); + const ids = useMemo( + () => + postId + .split( ',' ) + .map( ( id ) => parseInt( id, 10 ) ) + .filter( Number ), + [ postId ] + ); const { record, hasFinishedResolution } = useSelect( ( select ) => { const args = [ 'postType', postType, ids[ 0 ] ];