Woocommerce get_products return empty objects
问题 I'm building custom endpoint using Woocommerce Products and the query return 6 objects but empty don't now why is that? what I'm missing on my code below? Code add_action('rest_api_init', function () { register_rest_route( 'hash', 'related-products',array( 'methods' => 'GET', 'callback' => 'hash_realated_products' )); }); function hash_realated_products() { // Get 10 most recent product IDs in date descending order. $query = new WC_Product_Query( array( 'limit' => 6, 'status' => 'publish',