verygoodplugins

Untitled

May 8th, 2020
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.69 KB | None | 0 0
  1. function my_custom_export() {
  2.  
  3.     $args = array(
  4.         'numberposts' => - 1,
  5.         'post_type'   => 'shop_order',
  6.         'post_status' => array( 'wc-processing', 'wc-completed' ),
  7.         'fields'      => 'ids',
  8.         'order'       => 'ASC',
  9.         'meta_query'  => array(
  10.             array(
  11.                 'key'     => 'wpf_complete',
  12.                 'compare' => 'NOT EXISTS',
  13.             ),
  14.         ),
  15.         'date_query'  => array(
  16.             'after' => 'March 1 2020',
  17.         ),
  18.     );
  19.  
  20.     $orders = get_posts( $args );
  21.  
  22.     wpf_log( 'info', 0, 'Beginning <strong>WooCommerce Orders</strong> batch operation on ' . count( $orders ) . ' orders', array( 'source' => 'batch-process' ) );
  23.  
  24.     return $orders;
  25.  
  26. }
  27.  
  28. add_filter( 'wpf_batch_woocommerce_init', 'my_custom_export', 20 );
Add Comment
Please, Sign In to add comment