Skip to content
Docs
Get RestroPress

Filter

rpress_flat_delivery_fee_active

Updated
On this page

Filters whether the built-in flat delivery fee is active.

The flat delivery fee is only applied when this returns true. It defaults to true unless the RP_Delivery_Fee class exists, because the Delivery Fee extension replaces the flat fee when it is loaded. Return false to disable the flat fee and its settings field.

Parameters#

ParameterTypeDescription
$activeboolTrue when the RP_Delivery_Fee class does not exist.

Return value#

bool. True to use the built-in flat delivery fee.

Example#

function my_disable_flat_delivery_fee( $active ) {
	return false;
}
add_filter( 'rpress_flat_delivery_fee_active', 'my_disable_flat_delivery_fee' );

Notes#

The registered settings field for the flat fee is also hidden when this returns false.

Source#

Applied in:

  • includes/rp-delivery-fee-basic.php (line 28), in rpress_flat_delivery_fee_active()

See also#

Was this page helpful?