From 660080fdcf8a0ef538c826d951939c949b134d1f Mon Sep 17 00:00:00 2001 From: Ryan Welcher Date: Mon, 20 Jan 2025 16:34:47 -0500 Subject: [PATCH] Don't render the post selector if the posts don't have titles. --- src/components/post-include-controls.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/post-include-controls.js b/src/components/post-include-controls.js index 7d0df52..8859113 100644 --- a/src/components/post-include-controls.js +++ b/src/components/post-include-controls.js @@ -88,7 +88,8 @@ export const PostIncludeControls = ( { attributes, setAttributes } ) => { return
{ __( 'Loading…', 'advanced-query-loop' ) }
; } - 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; }