Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added filter when getting the earnings. #2287

Merged
merged 1 commit into from
Nov 9, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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