Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Bulk set EDD Commissions to "unpaid" for all commissions after a specific date
<?php
$commissions = get_posts( array(
'post_type' => 'edd_commission',
'posts_per_page' => -1,
'fields' => 'ids',
'date_query' => array(
'after' => array(
'year' => 2015,
'month' => 03,
'day' => 15
),
),
'tax_query' => array(
array(
'taxonomy' => 'edd_commission_status',
'terms' => 'paid',
'field' => 'slug'
)
)
) );
if( $commissions ) {
foreach( $commissions as $c ) {
eddc_set_commission_status( $c, 'unpaid' );
}
}
echo 'done';
@yudiarnanda

This comment has been minimized.

Copy link

yudiarnanda commented Sep 14, 2019

How to use this snippet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.