Skip to content

Instantly share code, notes, and snippets.

@pippinsplugins
Created July 21, 2015 00:34
Show Gist options
  • Save pippinsplugins/a0a938ddb4fbb8b8747d to your computer and use it in GitHub Desktop.
Save pippinsplugins/a0a938ddb4fbb8b8747d to your computer and use it in GitHub Desktop.
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
Copy link

How to use this snippet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment