Skip to content

Commit

Permalink
Handle post ids as numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
louwie17 committed Dec 17, 2024
1 parent ba6868a commit 9c55bef
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/edit-site/src/components/post-edit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ] ];
Expand Down

0 comments on commit 9c55bef

Please sign in to comment.