Description
The gravityflowvacation_balance filter allows the vacation balance to be modified by the user.
Parameters
Parameter | Type | Description |
---|---|---|
$total_available | Int | Total available leave |
$user_id | Int | ID of the User |
$annual_paid_time_off | Int | Annual paid time off leave |
$comp_days | Int | Comp days |
$hr_adjustment | Int | HR Adjustments |
$carry | Int | Carry over |
$approved | bool | Approved Yes/No |
Example
1 2 3 4 5 | 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?