function kb_get_product_group_items($product_id) { $terms = wp_get_post_terms( $product_id, 'kb_product_group' ); if (empty($terms) || is_wp_error($terms)) { return []; } $group = $terms[0]; $posts = get_posts([ 'post_type' => 'product', 'post_status' => 'publish', 'posts_per_page' => -1, 'post__not_in' => [$product_id], 'tax_query' => [ [ 'taxonomy' => 'kb_product_group', 'field' => 'term_id', 'terms' => $group->term_id, ] ], 'no_found_rows' => true, 'update_post_meta_cache' => false, 'update_post_term_cache' => false, ]); $items = []; foreach ($posts as $post) { $product = wc_get_product($post->ID); if (!$product) { continue; } $items[] = [ 'id' => $post->ID, 'card' => kb_get_product_loop_data($product), ]; } return $items; } https://sanjeshnovin.com/post-sitemap.xml 2026-06-21T22:19:50+00:00 https://sanjeshnovin.com/page-sitemap.xml 2026-06-21T21:43:23+00:00 https://sanjeshnovin.com/product-sitemap.xml 2026-07-25T19:10:20+00:00 https://sanjeshnovin.com/product-sitemap2.xml 2025-05-26T12:09:27+00:00 https://sanjeshnovin.com/product-sitemap3.xml 2025-05-26T12:23:12+00:00 https://sanjeshnovin.com/product-sitemap4.xml 2026-07-25T19:10:20+00:00 https://sanjeshnovin.com/book-sitemap.xml 2026-07-17T12:47:49+00:00 https://sanjeshnovin.com/category-sitemap.xml 2026-06-21T22:19:50+00:00 https://sanjeshnovin.com/product_brand-sitemap.xml 2026-07-25T19:10:20+00:00 https://sanjeshnovin.com/product_cat-sitemap.xml 2026-07-25T19:10:20+00:00 https://sanjeshnovin.com/product_tag-sitemap.xml 2026-07-25T19:10:20+00:00 https://sanjeshnovin.com/publisher-sitemap.xml 2026-07-25T19:10:20+00:00 https://sanjeshnovin.com/profile-sitemap.xml 2026-07-23T11:40:42+00:00