fc_is_current_step
Type: Filter
Filters whether a checkout step is the current step.
Signature
apply_filters( 'fc_is_current_step', $is_current_step, $step_id, $context );
Parameters
| Name | Type | Description |
|---|---|---|
$is_current_step | bool | Is current step. |
$step_id | string | Checkout step ID. |
$context | string | Context in which the hook runs. Default checkout. |
Since
4.0.0
Source: inc/checkout-steps.php
Examples
add_filter( 'fc_is_current_step',
/**
* Maybe set the contact step as the current step on the order pay page.
*
* @param bool $is_current_step Is current step.
* @param string $step_id Checkout step ID.
* @param string $context Context in which the hook runs. Default checkout.
* @return bool Filtered value.
*/
function( $is_current_step, $step_id, $context ) {
// Bail if not on order pay context
if ( 'order-pay' !== $context ) { return $is_current_step; }
// Bail if not the checking the contact step
if ( 'contact' !== $step_id ) { return $is_current_step; }
// Otherwise, return as current.
return true;
},
10,
3
);