php - How to get deleted orders (trashed) in Woocommerce -


I'm trying to get the waste order list from the WooCommerce Shop Order. Earlier, I tried with the status of order to publish back properly for my needs. Now woocommerce version 2.2+ they added post status because wc-complete something. I can not find garbage post in this case.

I tried

  function gettrashedorderlist () {$ args = array ('post_type' = & gt; 'shop_order', 'posts_per_page' = & gt; 1 ' ',' Post_status' = & gt; array ('trash')); Foreach (get_posts $$ as each order) {// something goes here}}  

I'm unable to get a trashed order list with the latest version. I also get

  function gettrashedorderlist () {$ args = array ('post_type' = & gt; 'shop_order', 'posts_per_page' = & gt; '- 1', 'post_status') Tried to do anything like that. = & Gt; Array ('wc-complete')); Foreach (get_posts ($ args) $ each) {// something goes here}}  

It is working but in this case I have a serious problem because this trash Displays all orders including made orders list. Not sure if I did something wrong or misunderstood.

Ideally when I'm trying to post status, instead of listing all the orders I listed them as wc-completed, in which I have trashed, trashed commands Should be shown except.

Is there any way to get this?

Thank you. You should not give a string, not an array = 'Gtc: mediafile = -1', '


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -