Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

subscriptions rest api (v1) wrong status filter: returns empty data

$
0
0

Replies: 1

subscriptions rest api (v1) returns empty data ([])
/wc/v1/subscriptions&status=active
/wc/v1/subscriptions&status=any
/wc/v1/subscriptions

in includes/abstarct/abstract-wc-rest-post-controller.php

prepare_items_query() excludes status from args and generate wrong SQL:

SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = ‘shop_subscription’ AND (wp_posts.post_status = ‘publish’) ORDER BY wp_posts.post_date DESC LIMIT 0, 10

Regardless of what status I send. Am I doing something wrong?

  • This topic was modified 36 minutes ago by badworker.
  • This topic was modified 27 minutes ago by badworker.
  • This topic was modified 23 minutes ago by badworker.

Viewing all articles
Browse latest Browse all 59525

Trending Articles