Skip to content

Commit

Permalink
Merge pull request #2287 from emgk/give-earnings-filter
Browse files Browse the repository at this point in the history
Added filter when getting the earnings.
  • Loading branch information
ravinderk committed Nov 9, 2017
2 parents 7cb1fdc + 8b047ce commit 36b2564
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions includes/payments/class-payment-stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,19 @@ public function get_earnings( $form_id = 0, $start_date = false, $end_date = fal
Give_Cache::set( $key, give_sanitize_amount_for_db( $earnings ), 60 * 60 );
}

/**
* Filter the earnings.
*
* @since 1.8.17
*
* @param float $earnings Earning amount.
* @param int $form_id Donation Form ID.
* @param string|bool $start_date Earning start date.
* @param string|bool $end_date Earning end date.
* @param string|bool $gateway_id Payment gateway id.
*/
$earnings = apply_filters( 'give_get_earnings', $earnings, $form_id, $start_date, $end_date, $gateway_id );

//return earnings
return round( $earnings, give_get_price_decimals( $form_id ) );

Expand Down

0 comments on commit 36b2564

Please sign in to comment.