Filter
rpress_checkout_service_fee_sublabel
On this page
Filters the sublabel shown under a checkout service chip.
Runs first in rpress_get_checkout_service_fee_sublabel(). Return a string, including an empty string to show no sublabel, to replace the computed text. Return null to let core compute it from the displayed fee, free-delivery threshold and fee extensions.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$sublabel | null | Default null, meaning no override. |
$service_type | string | Service type of the chip, delivery or pickup. |
$current | string | Service type currently selected (from the service_type cookie), or an empty string. |
Return value#
string|null. Sublabel text, or null to use the default.
Example#
function my_service_chip_sublabel( $sublabel, $service_type, $current ) {
if ( 'pickup' === $service_type ) {
return __( 'Ready in 15 minutes', 'my-plugin' );
}
return $sublabel;
}
add_filter( 'rpress_checkout_service_fee_sublabel', 'my_service_chip_sublabel', 10, 3 );
Source#
Applied in:
includes/rp-delivery-fee-basic.php(line 93), inrpress_get_checkout_service_fee_sublabel()
See also#
Was this page helpful?
