From 44a2de7f8d7c153c3bd39e219758ab4b27a05a7b Mon Sep 17 00:00:00 2001 From: picocodes Date: Tue, 9 Jul 2024 07:20:47 +0300 Subject: [PATCH] changes --- src/Objects/Collection.php | 5 +++++ src/Objects/Generic_Post_Type.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Objects/Collection.php b/src/Objects/Collection.php index 20a12752..146714de 100644 --- a/src/Objects/Collection.php +++ b/src/Objects/Collection.php @@ -911,6 +911,11 @@ public function handle_list_shortcode( $atts, $template ) { $items = $this->get_all( $query ); } + // Debug the query later. + if ( defined( 'NOPTIN_IS_TESTING' ) && NOPTIN_IS_TESTING ) { + noptin_error_log( $items, 'Item collection results' ); + } + if ( ! is_array( $items ) || empty( $items ) ) { if ( 'yes' === $atts['skiponempty'] ) { $GLOBALS['noptin_email_force_skip'] = array( diff --git a/src/Objects/Generic_Post_Type.php b/src/Objects/Generic_Post_Type.php index 5a7faab4..f4728267 100644 --- a/src/Objects/Generic_Post_Type.php +++ b/src/Objects/Generic_Post_Type.php @@ -158,7 +158,7 @@ public function get_all( $filters ) { noptin_error_log( count( $posts ), 'Post collection posts' ); } - return get_posts( $posts ); + return $posts; } /**