Skip to content
Docs
Get RestroPress

Filter

rpress_can_checkout

Updated
On this page

Filters whether the customer may check out.

Runs in rpress_can_checkout(). The default value is always true. Return false to block checkout.

Parameters#

ParameterTypeDescription
$can_checkoutboolTrue by default.

Return value#

bool. Whether checkout is allowed.

Example#

function my_can_checkout( $can_checkout ) {
	if ( ! is_user_logged_in() ) {
		return false;
	}
	return $can_checkout;
}
add_filter( 'rpress_can_checkout', 'my_can_checkout', 10, 1 );

Source#

Applied in:

  • includes/checkout/functions.php (line 58), in rpress_can_checkout()

See also#

Was this page helpful?