diff --git a/packages/block-library/src/post-author/edit.js b/packages/block-library/src/post-author/edit.js index ffb138694c376c..d23e0965dadda8 100644 --- a/packages/block-library/src/post-author/edit.js +++ b/packages/block-library/src/post-author/edit.js @@ -25,7 +25,7 @@ function PostAuthorEdit( { attributes, setAttributes, } ) { - const isDescendentOfQueryLoop = !! queryId; + const isDescendentOfQueryLoop = Number.isFinite( queryId ); const { authorId, authorDetails, authors } = useSelect( ( select ) => { const { getEditedEntityRecord, getUser, getUsers } = select( diff --git a/packages/block-library/src/post-content/edit.js b/packages/block-library/src/post-content/edit.js index 4a0c277a1f5cfe..b9a11f0d1bec82 100644 --- a/packages/block-library/src/post-content/edit.js +++ b/packages/block-library/src/post-content/edit.js @@ -66,7 +66,7 @@ function EditableContent( { layout, context = {} } ) { function Content( props ) { const { context: { queryId, postType, postId } = {} } = props; - const isDescendentOfQueryLoop = !! queryId; + const isDescendentOfQueryLoop = Number.isFinite( queryId ); const userCanEdit = useCanEditEntity( 'postType', postType, postId ); const isEditable = userCanEdit && ! isDescendentOfQueryLoop; diff --git a/packages/block-library/src/post-date/edit.js b/packages/block-library/src/post-date/edit.js index 97315736b005d3..2fa4507f1870a1 100644 --- a/packages/block-library/src/post-date/edit.js +++ b/packages/block-library/src/post-date/edit.js @@ -33,7 +33,7 @@ export default function PostDateEdit( { context: { postId, postType, queryId }, setAttributes, } ) { - const isDescendentOfQueryLoop = !! queryId; + const isDescendentOfQueryLoop = Number.isFinite( queryId ); const [ siteFormat ] = useEntityProp( 'root', 'site', 'date_format' ); const [ date, setDate ] = useEntityProp( 'postType', diff --git a/packages/block-library/src/post-excerpt/edit.js b/packages/block-library/src/post-excerpt/edit.js index 04c22acd2e36cb..a71bcc61567492 100644 --- a/packages/block-library/src/post-excerpt/edit.js +++ b/packages/block-library/src/post-excerpt/edit.js @@ -30,7 +30,7 @@ export default function PostExcerptEditor( { isSelected, context: { postId, postType, queryId }, } ) { - const isDescendentOfQueryLoop = !! queryId; + const isDescendentOfQueryLoop = Number.isFinite( queryId ); const userCanEdit = useCanEditEntity( 'postType', postType, postId ); const isEditable = userCanEdit && ! isDescendentOfQueryLoop; const [ diff --git a/packages/block-library/src/post-featured-image/edit.js b/packages/block-library/src/post-featured-image/edit.js index ca52ffcb694057..6d38eb17f79b15 100644 --- a/packages/block-library/src/post-featured-image/edit.js +++ b/packages/block-library/src/post-featured-image/edit.js @@ -52,7 +52,7 @@ function PostFeaturedImageDisplay( { setAttributes, context: { postId, postType, queryId }, } ) { - const isDescendentOfQueryLoop = !! queryId; + const isDescendentOfQueryLoop = Number.isFinite( queryId ); const { isLink, height, width, scale } = attributes; const [ featuredImage, setFeaturedImage ] = useEntityProp( 'postType', diff --git a/packages/block-library/src/post-title/edit.js b/packages/block-library/src/post-title/edit.js index 28ab04ed556851..18904364774fea 100644 --- a/packages/block-library/src/post-title/edit.js +++ b/packages/block-library/src/post-title/edit.js @@ -30,7 +30,7 @@ export default function PostTitleEdit( { context: { postType, postId, queryId }, } ) { const TagName = 0 === level ? 'p' : 'h' + level; - const isDescendentOfQueryLoop = !! queryId; + const isDescendentOfQueryLoop = Number.isFinite( queryId ); const userCanEdit = useCanEditEntity( 'postType', postType, postId ); const [ rawTitle = '', setTitle, fullTitle ] = useEntityProp( 'postType',