Skip to content

Commit

Permalink
Don't render the post selector if the posts don't have titles.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanwelcher committed Jan 20, 2025
1 parent 747a6b4 commit 660080f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/post-include-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ export const PostIncludeControls = ( { attributes, setAttributes } ) => {
return <div>{ __( 'Loading…', 'advanced-query-loop' ) }</div>;
}

if ( posts.length > 0 && ! posts[ 0 ].title.rendered ) {
// If the first post in the posts array does not have a title, don't render the component.
if ( posts.length > 0 && ! posts[ 0 ].title ) {
return null;
}

Expand Down

0 comments on commit 660080f

Please sign in to comment.