Automattic\WooCommerce\Internal\Admin\Settings\PaymentsProviders\WooPayments

WooPaymentsService::clear_onboarding_step_blockedprivateWC 1.0

Clear the blocked status of an onboarding step.

Метод класса: WooPaymentsService{}

Хуков нет.

Возвращает

true|false. Whether the onboarding step was cleared from blocked status. Returns false if the step was not blocked.

Использование

// private - только в коде основоного (родительского) класса
$result = $this->clear_onboarding_step_blocked( $step_id, $location ): bool;
$step_id(строка) (обязательный)
The ID of the onboarding step.
$location(строка) (обязательный)
The location for which we are onboarding. This is an ISO 3166-1 alpha-2 country code.

Код WooPaymentsService::clear_onboarding_step_blocked() WC 10.7.0

private function clear_onboarding_step_blocked( string $step_id, string $location ): bool {
	if ( ! $this->is_onboarding_step_blocked( $step_id, $location ) ) {
		return false;
	}

	// Clear any error for the step.
	$this->save_nox_profile_onboarding_step_data_entry( $step_id, $location, 'error', array() );

	$statuses = (array) $this->get_nox_profile_onboarding_step_entry( $step_id, $location, 'statuses' );

	// Clear the blocked status.
	unset( $statuses[ self::ONBOARDING_STEP_STATUS_BLOCKED ] );

	// Store the updated step data.
	return $this->save_nox_profile_onboarding_step_entry( $step_id, $location, 'statuses', $statuses );
}