Skip to content
Docs
Get RestroPress

Filter

rpress_total_earnings

Updated
On this page

Filters the total earnings value returned by rpress_get_total_earnings().

Runs on the final value of rpress_get_total_earnings(), after negative totals have been clamped to 0 and the amount rounded to the store's currency decimals. Use it to display an adjusted figure, for example to add earnings recorded outside RestroPress.

Parameters#

ParameterTypeDescription
$totalfloatThe rounded total earnings.

Return value#

float. The total earnings.

Example#

add_filter( 'rpress_total_earnings', 'my_add_offline_earnings', 10, 1 );
function my_add_offline_earnings( $total ) {
	return $total + (float) get_option( 'my_offline_earnings', 0 );
}

Source#

Applied in:

  • includes/payments/functions.php (line 1163), in rpress_get_total_earnings()

See also#

Was this page helpful?