WordPress at Your Fingertips
function is not described

WC_Webhook::is_valid_user_action() private WC 3.6.0

Validates user actions.

{} It's a method of the class: WC_Webhook{}

No Hooks.

Return

true|false. True if validation passes.

Usage

// private - for code of main (parent) class only
$result = $this->is_valid_user_action( $arg );
$arg(mixed) (required)
First hook argument.

Changelog

Since 3.6.0 Introduced.

Code of WC_Webhook::is_valid_user_action() WC 5.9.0

private function is_valid_user_action( $arg ) {
	$user = get_userdata( absint( $arg ) );

	// Only deliver deleted customer event for users with customer role.
	if ( ! $user || ! in_array( 'customer', (array) $user->roles, true ) ) {
		return false;
	}

	return true;
}