Filter
rpress_has_fee_extension
On this page
Filters whether a fee-related extension is considered active for the service chips.
Runs while building the checkout service chip sublabel, after core has checked for the Delivery Fee extension and the extra-fees setting. When both this and the non-zero flag are true, the 'Free' sublabel is suppressed for the service. Use it to register a custom fee plugin.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$has_fee_extension | bool | Whether a known fee extension was detected. |
$service_type | string | Service type of the chip. |
Return value#
bool. True if a fee extension is in use.
Example#
function my_has_fee_extension( $has_fee_extension, $service_type ) {
return $has_fee_extension || class_exists( 'My_Plugin_Fees' );
}
add_filter( 'rpress_has_fee_extension', 'my_has_fee_extension', 10, 2 );
Notes#
Pair with rpress_fee_extension_non_zero; 'Free' is only hidden when both are true.
Source#
Applied in:
includes/rp-delivery-fee-basic.php(line 143), inrpress_get_checkout_service_fee_sublabel()
See also#
Was this page helpful?
