Skip to content
Docs
Get RestroPress

Action

rpress_customer_post_create

Updated
On this page

Fires after a customer is created.

Fires at the end of RPRESS_Customer::create(), after the database write has been attempted. The first argument is the customer ID on success and false otherwise, so check it before using it.

Parameters#

ParameterTypeDescription
$createdint|falseThe customer ID if created successfully, otherwise false.
$argsarraySanitized customer data such as payment_ids, name and email.

Example#

function my_customer_post_create( $created, $args ) {
	if ( $created ) {
		update_option( 'my_last_customer_id', (int) $created );
	}
}
add_action( 'rpress_customer_post_create', 'my_customer_post_create', 10, 2 );

Source#

Fired from:

  • includes/class-rpress-customer.php (line 212), in RPRESS_Customer::create()

See also#

Was this page helpful?