Skip to content
Docs
Get RestroPress

Action

rpress_pre_customer_disconnect_user_id

Updated
On this page

Fires before a customer is disconnected from their linked WordPress user.

Runs in rpress_disconnect_customer_user_id() after nonce and capability checks and before the customer's user_id is set to 0. The second argument is the user ID that is about to be unlinked.

Parameters#

ParameterTypeDescription
$customer_idintThe customer ID.
$user_idintThe WordPress user ID currently linked to the customer.

Example#

function my_before_disconnect( $customer_id, $user_id ) {
	update_option( 'my_last_disconnected_user', (int) $user_id );
}
add_action( 'rpress_pre_customer_disconnect_user_id', 'my_before_disconnect', 10, 2 );

Source#

Fired from:

  • includes/admin/customers/customer-actions.php (line 673), in rpress_disconnect_customer_user_id()

See also#

Was this page helpful?