Skip to content

Commit

Permalink
Fix: No posts in the editor when posts_per_page is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
tomusborne committed Nov 19, 2024
1 parent 2d02461 commit ffdd81f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/blocks/looper/components/LoopInnerBlocksRenderer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,9 @@ export function LoopInnerBlocksRenderer( props ) {

const loopItemsContext = useMemo( () => {
if ( hasResolvedData && Array.isArray( data ) ) {
let perPage = query?.posts_per_page ?? 10;
let perPage = query?.posts_per_page
? query?.posts_per_page
: 10;

if ( '-1' === perPage?.toString() ) {
perPage = data.length;
Expand Down

0 comments on commit ffdd81f

Please sign in to comment.