gravityflowvacation_balance

Description

The gravityflowvacation_balance filter allows the vacation balance to be modified by the user.

Parameters

ParameterTypeDescription
$total_availableIntTotal available leave
$user_idIntID of the User
$annual_paid_time_offIntAnnual paid time off leave
$comp_daysIntComp days
$hr_adjustmentIntHR Adjustments
$carryIntCarry over
$approvedboolApproved Yes/No

Example

add_action( 'gravityflowvacation_balance', 'gravityflow_gravityflowvacation_balance', 10, 7 );
function gravityflow_gravityflowvacation_balance( $total_available, $user_id, $annual_paid_time_off, $comp_days, $hr_adjustment, $carry, $approved ) {
	// Adjust the calculation and return the new balance.
    return $total_available;
}

Placement

This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.

See also the PHP section in this article: Where Do I Put This Code?